v.help: run help init with the current compiler under test (#19990)

This commit is contained in:
Kim Shrier 2023-11-26 08:12:09 -07:00 committed by GitHub
parent 70b33105d9
commit eaacf8314e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,10 +10,7 @@ fn hdir(base string) string {
} }
fn help_dir() string { fn help_dir() string {
mut vexe := os.getenv('VEXE') vexe := get_vexe()
if vexe == '' {
vexe = os.executable()
}
if vexe != '' { if vexe != '' {
return hdir(os.dir(vexe)) return hdir(os.dir(vexe))
} }
@ -42,7 +39,8 @@ pub fn print_and_exit(topic string, opts ExitOptions) {
} }
} }
if topic in help.cli_topics { if topic in help.cli_topics {
os.system('${@VEXE} ${topic} --help') vexe := get_vexe()
os.system('${os.quoted_path(vexe)} ${topic} --help')
exit(opts.exit_code) exit(opts.exit_code)
} }
mut topic_path := '' mut topic_path := ''
@ -79,3 +77,11 @@ fn print_known_topics() {
} }
println(res) println(res)
} }
fn get_vexe() string {
mut vexe := os.getenv('VEXE')
if vexe == '' {
vexe = os.executable()
}
return vexe
}