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

unify vexe_path

This commit is contained in:
yuyi
2020-02-20 18:33:01 +08:00
committed by GitHub
parent fcd97f513a
commit d51019dd77
11 changed files with 39 additions and 73 deletions

View File

@ -733,7 +733,7 @@ pub fn (v &V) get_user_files() []string {
mut user_files := []string
// See cmd/tools/preludes/README.md for more info about what preludes are
vroot := filepath.dir(vexe_path())
vroot := filepath.dir(pref.vexe_path())
preludes_path := filepath.join(vroot,'cmd','tools','preludes')
if v.pref.is_live {
user_files << filepath.join(preludes_path,'live_main.v')
@ -844,16 +844,6 @@ pub fn (v &V) log(s string) {
println(s)
}
pub fn vexe_path() string {
vexe := os.getenv('VEXE')
if '' != vexe {
return vexe
}
real_vexe_path := os.realpath(os.executable())
os.setenv('VEXE', real_vexe_path, true)
return real_vexe_path
}
pub fn verror(s string) {
println('V error: $s')
os.flush_stdout()