aboutsummaryrefslogtreecommitdiff
path: root/run.ps1
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-02 15:00:23 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-02 15:00:23 +0800
commit1f889d429133f920411db8ea1b88a68657f79435 (patch)
tree3cd0b2324b8a1ecb5365216042ee3d1f8e169ba6 /run.ps1
parent1eb45c9c4afc631cfc97dd78ada1ab797627dec4 (diff)
feat: add support for Ruby, Perl, Go, Zig, and Nim scripts
Diffstat (limited to 'run.ps1')
-rw-r--r--run.ps150
1 files changed, 50 insertions, 0 deletions
diff --git a/run.ps1 b/run.ps1
index bfea866..782fd46 100644
--- a/run.ps1
+++ b/run.ps1
@@ -26,6 +26,36 @@ if (Test-Path ".run/src/bin/*.ps1") {
}
}
+if (Test-Path ".run/src/bin/*.rb") {
+ Get-ChildItem -Path ".run/src/bin/*.rb" | ForEach-Object {
+ $tools[$_.BaseName] = @{ Type = "rb"; Path = $_.FullName }
+ }
+}
+
+if (Test-Path ".run/src/bin/*.pl") {
+ Get-ChildItem -Path ".run/src/bin/*.pl" | ForEach-Object {
+ $tools[$_.BaseName] = @{ Type = "pl"; Path = $_.FullName }
+ }
+}
+
+if (Test-Path ".run/src/bin/*.go") {
+ Get-ChildItem -Path ".run/src/bin/*.go" | ForEach-Object {
+ $tools[$_.BaseName] = @{ Type = "go"; Path = $_.FullName }
+ }
+}
+
+if (Test-Path ".run/src/bin/*.zig") {
+ Get-ChildItem -Path ".run/src/bin/*.zig" | ForEach-Object {
+ $tools[$_.BaseName] = @{ Type = "zig"; Path = $_.FullName }
+ }
+}
+
+if (Test-Path ".run/src/bin/*.nim") {
+ Get-ChildItem -Path ".run/src/bin/*.nim" | ForEach-Object {
+ $tools[$_.BaseName] = @{ Type = "nim"; Path = $_.FullName }
+ }
+}
+
if (Test-Path ".run/src/bin/*.exe") {
Get-ChildItem -Path ".run/src/bin/*.exe" | ForEach-Object {
$tools[$_.BaseName] = @{ Type = "exe"; Path = $_.FullName }
@@ -59,6 +89,11 @@ if ($args.Count -eq 0) {
"py" { "Python" }
"rs" { "Rust" }
"ps1" { "PowerShell" }
+ "rb" { "Ruby" }
+ "pl" { "Perl" }
+ "go" { "Go" }
+ "zig" { "Zig" }
+ "nim" { "Nim" }
"exe" { "Binary" }
}
$entry = " " + $i.ToString().PadRight($num_w) + ") " + $name.PadRight($max_name) + " [$lang]"
@@ -96,6 +131,21 @@ switch ($info.Type) {
"ps1" {
& $info.Path @script_args
}
+ "rb" {
+ ruby $info.Path $script_args
+ }
+ "pl" {
+ perl $info.Path $script_args
+ }
+ "go" {
+ go run $info.Path $script_args
+ }
+ "zig" {
+ zig run $info.Path $script_args
+ }
+ "nim" {
+ nim r --hints:off $info.Path $script_args
+ }
"exe" {
& $info.Path $script_args
}