Skip to content

Commit c77292a

Browse files
committed
tools: fix v buf file.v, when run in a folder != vroot
1 parent 7040514 commit c77292a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/tools/vbug.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string, user_args
6161
}
6262
}
6363
if result.exit_code == 0 {
64+
real_generated_file := './' + generated_file
6465
defer {
6566
os.rm(generated_file) or {
6667
if is_verbose {
@@ -71,7 +72,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string, user_args
7172
run := is_yes
7273
|| ask('It looks like the compilation went well, do you want to run the file?')
7374
if run {
74-
result = runv('Run', generated_file)
75+
result = runv('Run', real_generated_file)
7576
if result.exit_code == 0 && !is_yes {
7677
elog('> The file ran correctly as well.')
7778
confirm_or_exit('Are you sure you want to continue?')
@@ -165,7 +166,7 @@ ${vdoctor_output}
165166
```
166167
167168
**What did you do?**
168-
`./v -g -o vdbg cmd/v && ./vdbg ${user_args} ${file_path} && ${generated_file}`
169+
`./v -g -o vdbg cmd/v && ./vdbg ${user_args} ${file_path} && ./${generated_file}`
169170
{file_content}
170171
171172
**What did you see?**

0 commit comments

Comments
 (0)