From c2064b2cc0073da3f33918a3c5b327f4048f1bc2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 20 Dec 2020 19:01:02 +0200 Subject: [PATCH] ci: more args = os.args fixes --- cmd/tools/vbuild-examples.v | 3 +-- cmd/tools/vbuild-tools.v | 13 +++++++------ cmd/tools/vtest-compiler.v | 3 +-- examples/spectral.v | 5 ++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/cmd/tools/vbuild-examples.v b/cmd/tools/vbuild-examples.v index fe5ecc3a61..82ddc1e968 100644 --- a/cmd/tools/vbuild-examples.v +++ b/cmd/tools/vbuild-examples.v @@ -4,8 +4,7 @@ import os import testing fn main() { - args := os.args - args_string := args[1..].join(' ') + args_string := os.args[1..].join(' ') params := args_string.all_before('build-examples') if testing.v_build_failing(params, 'examples') { exit(1) diff --git a/cmd/tools/vbuild-tools.v b/cmd/tools/vbuild-tools.v index 74ff47ccc8..c7d7585032 100644 --- a/cmd/tools/vbuild-tools.v +++ b/cmd/tools/vbuild-tools.v @@ -10,16 +10,16 @@ fn p(s string) string { } fn main() { - args := os.args - args_string := args[1..].join(' ') + args_string := os.args[1..].join(' ') skips := []string{} vexe := os.getenv('VEXE') vroot := os.dir(vexe) - util.ensure_modules_for_all_tools_are_installed('-v' in args) + util.ensure_modules_for_all_tools_are_installed('-v' in os.args) folder := 'cmd/tools' main_label := 'Building $folder ...' finish_label := 'building $folder' - mut session := testing.prepare_test_session(args_string.all_before('build-tools'), folder, skips, main_label) + mut session := testing.prepare_test_session(args_string.all_before('build-tools'), + folder, skips, main_label) session.rm_binaries = false session.test() eprintln(session.benchmark.total_message(finish_label)) @@ -27,10 +27,11 @@ fn main() { exit(1) } // - mut executables := os.ls(session.vtmp_dir)? + mut executables := os.ls(session.vtmp_dir) ? executables.sort() executables = executables.filter(it !in ['gen1m', 'gen_vc', 'fast', 'wyhash']) for exe in executables { - os.mv_by_cp(os.join_path(session.vtmp_dir, exe), os.join_path(vroot, 'cmd', 'tools', exe)) + os.mv_by_cp(os.join_path(session.vtmp_dir, exe), os.join_path(vroot, 'cmd', 'tools', + exe)) } } diff --git a/cmd/tools/vtest-compiler.v b/cmd/tools/vtest-compiler.v index 94623c8efd..1fb10fa2ef 100644 --- a/cmd/tools/vtest-compiler.v +++ b/cmd/tools/vtest-compiler.v @@ -6,8 +6,7 @@ import benchmark import v.pref fn main() { - args := os.args - args_string := args[1..].join(' ') + args_string := os.args[1..].join(' ') v_test_compiler(args_string.all_before('test-compiler')) } diff --git a/examples/spectral.v b/examples/spectral.v index fddc6c1b3f..6923b2a662 100644 --- a/examples/spectral.v +++ b/examples/spectral.v @@ -45,10 +45,9 @@ fn a_times_transp(mut v []f64, u []f64) { } fn main() { - args := os.args mut n := 0 - if args.len == 2 { - n = strconv.atoi(args[1]) + if os.args.len == 2 { + n = strconv.atoi(os.args[1]) } else { n = 0 }