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

tools: update oldv to be faster for the most common cases

This commit is contained in:
Delyan Angelov
2021-04-06 11:43:46 +03:00
parent de5e603248
commit 9bb3a5b3a3
3 changed files with 68 additions and 19 deletions

View File

@@ -97,12 +97,14 @@ fn main() {
}
context.compile_oldv_if_needed()
scripting.chdir(context.path_v)
scripting.cprintln('# v commit hash: $context.commit_v_hash')
scripting.cprintln('# checkout folder: $context.path_v')
shorter_hash := context.commit_v_hash[0..10]
scripting.cprintln('# v commit hash: $shorter_hash | folder: $context.path_v')
if context.cmd_to_run.len > 0 {
scripting.cprintln_strong('# command: ${context.cmd_to_run:-34s}')
cmdres := os.execute_or_panic(context.cmd_to_run)
scripting.cprintln('# command: ${context.cmd_to_run:-34s} exit code: ${cmdres.exit_code:-4d} result:')
println(cmdres.output)
scripting.cprintln_strong('# exit code: ${cmdres.exit_code:-4d}')
scripting.cprint_strong('# result: ')
print(cmdres.output)
exit(cmdres.exit_code)
}
}