diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-06-12 20:23:09 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-06-12 20:23:09 +0800 |
| commit | 834c2412fa6a795ff3bd793ad2bbb80e180a7702 (patch) | |
| tree | cdbe5ae928bac22fe2b1a12b5cff0838a584f36c /run-tools.ps1 | |
| parent | e94787a4f2633aee6578d54ad1bcbd97384634e4 (diff) | |
Pass through tool arguments to scripts and binaries
Diffstat (limited to 'run-tools.ps1')
| -rw-r--r-- | run-tools.ps1 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/run-tools.ps1 b/run-tools.ps1 index 9bea120..7aa2c9c 100644 --- a/run-tools.ps1 +++ b/run-tools.ps1 @@ -41,16 +41,19 @@ if ($target_name -match '^\d+$') { } } +# Collect remaining arguments to pass to the script +$script_args = $args[1..$args.Count] + $script_file_ps1 = "dev_tools/scripts/${target_name}.ps1" $script_file_py = "dev_tools/scripts/${target_name}.py" $rust_file = "dev_tools/src/bin/${target_name}.rs" if (Test-Path $script_file_ps1) { - & $script_file_ps1 + & $script_file_ps1 $script_args } elseif (Test-Path $script_file_py) { - python $script_file_py + python $script_file_py $script_args } elseif (Test-Path $rust_file) { - cargo run --manifest-path dev_tools/Cargo.toml --bin $target_name --quiet + cargo run --manifest-path dev_tools/Cargo.toml --bin $target_name --quiet -- $script_args } else { Write-Host "Error: target '$target_name' does not exist as a script or Rust program" exit 1 |
