tools: improve windows support in oldv (it now can run in cmd.exe, not just in a Git Bash shell)

This commit is contained in:
Delyan Angelov 2023-08-26 09:07:14 +03:00
parent 570a12da8d
commit 636aae243c
3 changed files with 28 additions and 13 deletions

View file

@ -165,7 +165,8 @@ pub fn exit_0_status(cmd string) bool {
pub fn tool_must_exist(toolcmd string) {
verbose_trace(modfn(@MOD, @FN), toolcmd)
if exit_0_status('type ${toolcmd}') {
where_is_cmd := if os.user_os() == 'windows' { 'where' } else { 'type' }
if exit_0_status('${where_is_cmd} ${toolcmd}') {
return
}
eprintln('Missing tool: ${toolcmd}')