From 738f847f891fd8c792356cfb8d21944192615bef Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 5 Jan 2025 20:49:08 +0200 Subject: [PATCH] tools: improve output of `v bug file.v`, fix `v bug /long/abs/path/file.v` too --- cmd/tools/vbug.v | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cmd/tools/vbug.v b/cmd/tools/vbug.v index c140eb22822d29..51723ecd536fb2 100644 --- a/cmd/tools/vbug.v +++ b/cmd/tools/vbug.v @@ -11,6 +11,11 @@ fn olog(msg string) { println(term.colorize(term.green, msg)) } +fn vversion() string { + vexe := os.getenv('VEXE') + return os.execute('${os.quoted_path(vexe)} version').output.trim_space() +} + // get output from `v doctor` fn get_vdoctor_output(is_verbose bool) string { vexe := os.getenv('VEXE') @@ -61,7 +66,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 + real_generated_file := os.real_path(generated_file) defer { os.rm(generated_file) or { if is_verbose { @@ -160,13 +165,15 @@ fn main() { // When updating this template, make sure to update `.github/ISSUE_TEMPLATE/bug_report.md` too raw_body := ' -**V doctor:** -``` + +
+V version: ${vversion()}, press to see full `v doctor` output + ${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} && ${os.real_path(generated_file)}` {file_content} **What did you see?**