1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools: do show the output of c2v, when it fails

This commit is contained in:
Delyan Angelov 2022-06-19 17:08:21 +03:00
parent 7b1ade237b
commit 37ef1ee453
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -25,6 +25,7 @@ fn main() {
println('Compiling c2v ...') println('Compiling c2v ...')
res2 := os.execute('v -d trace_verbose -g -o c2v -experimental -w .') res2 := os.execute('v -d trace_verbose -g -o c2v -experimental -w .')
if res2.exit_code != 0 { if res2.exit_code != 0 {
eprintln(res2.output)
eprintln('Failed to compile C2V. This should never happen, please report it via GitHub.') eprintln('Failed to compile C2V. This should never happen, please report it via GitHub.')
exit(2) exit(2)
} }
@ -38,9 +39,9 @@ fn main() {
os.chdir(os.wd_at_startup)? os.chdir(os.wd_at_startup)?
res := os.execute('$c2v_bin $passed_args') res := os.execute('$c2v_bin $passed_args')
if res.exit_code != 0 { if res.exit_code != 0 {
eprintln('C2V failed to translate this file. This should never happen, please report it via GitHub.') eprintln(res.output)
eprintln('C2V failed to translate. Please report it via GitHub.')
exit(4) exit(4)
} }
println('Success!')
// println(res.output) // println(res.output)
} }