From 1f889d429133f920411db8ea1b88a68657f79435 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 2 Jul 2026 15:00:23 +0800 Subject: feat: add support for Ruby, Perl, Go, Zig, and Nim scripts --- run.ps1 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'run.ps1') 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 } -- cgit