From c77292ac2cc446f11d831717880a4126adf0b835 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 5 Jan 2025 18:46:45 +0200 Subject: [PATCH] tools: fix `v buf file.v`, when run in a folder != vroot --- cmd/tools/vbug.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/tools/vbug.v b/cmd/tools/vbug.v index d4c4c88d42..c140eb2282 100644 --- a/cmd/tools/vbug.v +++ b/cmd/tools/vbug.v @@ -61,6 +61,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string, user_args } } if result.exit_code == 0 { + real_generated_file := './' + generated_file defer { os.rm(generated_file) or { if is_verbose { @@ -71,7 +72,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string, user_args run := is_yes || ask('It looks like the compilation went well, do you want to run the file?') if run { - result = runv('Run', generated_file) + result = runv('Run', real_generated_file) if result.exit_code == 0 && !is_yes { elog('> The file ran correctly as well.') confirm_or_exit('Are you sure you want to continue?') @@ -165,7 +166,7 @@ ${vdoctor_output} ``` **What did you do?** -`./v -g -o vdbg cmd/v && ./vdbg ${user_args} ${file_path} && ${generated_file}` +`./v -g -o vdbg cmd/v && ./vdbg ${user_args} ${file_path} && ./${generated_file}` {file_content} **What did you see?**