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

cc(): print compilation error correctly

This commit is contained in:
Alexander Medvednikov
2019-08-18 01:18:05 +03:00
parent fe2d2bd2a3
commit 8e1c31e860
2 changed files with 6 additions and 5 deletions

View File

@@ -890,12 +890,13 @@ mut args := ''
println(cmd)
}
ticks := time.ticks()
_ := os.exec(cmd) or {
res := os.exec(cmd) or { panic(err) }
if res.exit_code != 0 {
if v.pref.is_debug {
println(err)
println(res.output)
} else {
print(err.limit(200))
if err.len > 200 {
print(res.output.limit(200))
if res.output.len > 200 {
println('...\n(Use `v -debug` to print the entire error message)\n')
}
}