aboutsummaryrefslogtreecommitdiff
path: root/run-tools.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'run-tools.ps1')
-rw-r--r--run-tools.ps125
1 files changed, 19 insertions, 6 deletions
diff --git a/run-tools.ps1 b/run-tools.ps1
index fa06ecd..43e39d8 100644
--- a/run-tools.ps1
+++ b/run-tools.ps1
@@ -12,15 +12,28 @@ if ($args.Count -eq 0) {
} else {
Write-Host "Warning: dev_tools/src/bin directory does not exist"
}
+ if (Test-Path "dev_tools/scripts") {
+ $scripts = Get-ChildItem -Path "dev_tools/scripts/*.ps1"
+ foreach ($script in $scripts) {
+ if ($script -is [System.IO.FileInfo]) {
+ Write-Host $script.BaseName
+ }
+ }
+ } else {
+ Write-Host "Warning: dev_tools/scripts directory does not exist"
+ }
exit 1
}
-$target_bin = $args[0]
-$target_file = "dev_tools/src/bin/${target_bin}.rs"
+$target_name = $args[0]
+$script_file = "dev_tools/scripts/${target_name}.ps1"
+$rust_file = "dev_tools/src/bin/${target_name}.rs"
-if (-not (Test-Path $target_file)) {
- Write-Host "Error: target file '$target_file' does not exist"
+if (Test-Path $script_file) {
+ & $script_file
+} elseif (Test-Path $rust_file) {
+ cargo run --manifest-path dev_tools/Cargo.toml --bin $target_name
+} else {
+ Write-Host "Error: target '$target_name' does not exist as a script or Rust program"
exit 1
}
-
-cargo run --manifest-path dev_tools/Cargo.toml --bin $args[0]