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

cmd: show cleaner messages, when v can not compile a tool, or update itself

This commit is contained in:
Daniel Däschle
2020-04-07 16:56:33 +02:00
committed by GitHub
parent 0024ff848d
commit 7cf9b32742
3 changed files with 35 additions and 13 deletions

View File

@@ -142,7 +142,12 @@ pub fn launch_tool(is_verbose bool, tool_name string) {
}
tool_compilation := os.exec(compilation_command) or { panic(err) }
if tool_compilation.exit_code != 0 {
panic('V tool "$tool_source" could not be compiled\n' + tool_compilation.output)
mut err := 'Permission denied'
if !tool_compilation.output.contains('Permission denied') {
err = '\n$tool_compilation.output'
}
eprintln('cannot compile $tool_source: $err')
exit(1)
}
}
if is_verbose {