all: update chdir usages

pull/11328/head
Alexander Medvednikov 2021-08-28 09:39:18 +03:00
parent 853d3cb83e
commit 29f550158e
4 changed files with 4 additions and 4 deletions

View File

@ -444,7 +444,7 @@ pub fn building_any_v_binaries_failed() bool {
vexe := pref.vexe_path()
parent_dir := os.dir(vexe)
vlib_should_be_present(parent_dir)
os.chdir(parent_dir)
os.chdir(parent_dir) or { panic(err) }
mut failed := false
v_build_commands := ['$vexe -o v_g -g cmd/v', '$vexe -o v_prod_g -prod -g cmd/v',
'$vexe -o v_cg -cg cmd/v', '$vexe -o v_prod_cg -prod -cg cmd/v',

View File

@ -133,7 +133,7 @@ const (
fn main() {
vexe := pref.vexe_path()
vroot := os.dir(vexe)
os.chdir(vroot)
os.chdir(vroot) or { panic(err) }
args := os.args.clone()
args_string := args[1..].join(' ')
cmd_prefix := args_string.all_before('test-self')

View File

@ -5,7 +5,7 @@ const source = 'vlib/flag/testdata/simplest_flag_program.v'
const simple_flag_app_executable = os.real_path(os.join_path(os.cache_dir(), 'simple_flag_app.exe'))
fn testsuite_begin() {
os.chdir(@VMODROOT)
os.chdir(@VMODROOT) or {}
os.rm(simple_flag_app_executable) or {}
res := os.execute('${@VEXE} -o $simple_flag_app_executable $source')
assert res.exit_code == 0

View File

@ -5,7 +5,7 @@ const the_source = 'vlib/flag/testdata/usage_example.v'
const the_executable = os.real_path(os.join_path(os.cache_dir(), 'flag_usage_example_app.exe'))
fn testsuite_begin() {
os.chdir(@VMODROOT)
os.chdir(@VMODROOT) or {}
os.rm(the_executable) or {}
res := os.execute('${@VEXE} -o $the_executable $the_source')
assert res.exit_code == 0