Skip to content

Commit 738f847

Browse files
committed
tools: improve output of v bug file.v, fix v bug /long/abs/path/file.v too
1 parent 6eb1408 commit 738f847

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

‎cmd/tools/vbug.v‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ fn olog(msg string) {
1111
println(term.colorize(term.green, msg))
1212
}
1313

14+
fn vversion() string {
15+
vexe := os.getenv('VEXE')
16+
return os.execute('${os.quoted_path(vexe)} version').output.trim_space()
17+
}
18+
1419
// get output from `v doctor`
1520
fn get_vdoctor_output(is_verbose bool) string {
1621
vexe := os.getenv('VEXE')
@@ -61,7 +66,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string, user_args
6166
}
6267
}
6368
if result.exit_code == 0 {
64-
real_generated_file := './' + generated_file
69+
real_generated_file := os.real_path(generated_file)
6570
defer {
6671
os.rm(generated_file) or {
6772
if is_verbose {
@@ -160,13 +165,15 @@ fn main() {
160165

161166
// When updating this template, make sure to update `.github/ISSUE_TEMPLATE/bug_report.md` too
162167
raw_body := '<!-- It is advisable to update all relevant modules using `v outdated` and `v install` -->
163-
**V doctor:**
164-
```
168+
169+
<details>
170+
<summary>V version: ${vversion()}, press to see full `v doctor` output</summary>
171+
165172
${vdoctor_output}
166-
```
173+
</details>
167174
168175
**What did you do?**
169-
`./v -g -o vdbg cmd/v && ./vdbg ${user_args} ${file_path} && ./${generated_file}`
176+
`./v -g -o vdbg cmd/v && ./vdbg ${user_args} ${file_path} && ${os.real_path(generated_file)}`
170177
{file_content}
171178
172179
**What did you see?**

0 commit comments

Comments
 (0)