From 1eb45c9c4afc631cfc97dd78ada1ab797627dec4 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 2 Jul 2026 14:57:31 +0800 Subject: feat: add support for running binary executables Add detection and execution of standalone binary files (without extensions in shell, with .exe in PowerShell) to the tool runner --- run.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'run.sh') diff --git a/run.sh b/run.sh index 62e08ac..1d58ffa 100644 --- a/run.sh +++ b/run.sh @@ -32,6 +32,15 @@ for file in .run/src/bin/*.sh; do fi done +for file in .run/src/bin/*; do + if [ -f "$file" ]; then + name=$(basename "$file") + if [[ ! "$name" == *.* ]]; then + tools["$name"]="binary" + fi + fi +done + if [ $# -eq 0 ]; then sorted_names=($(echo "${!tools[@]}" | tr ' ' '\n' | sort)) total=${#sorted_names[@]} @@ -63,6 +72,7 @@ if [ $# -eq 0 ]; then py) lang="Python";; rs) lang="Rust";; sh) lang="Shell";; + binary) lang="Binary";; esac entry=$(printf " %-*d) %-*s [%s]" $num_w $i $max_name $name $lang) printf "│%-*s│\n" $inner_w "$entry" @@ -145,4 +155,8 @@ CSPROJ cp ".run/src/bin/$target_name.cs" "$temp_dir/Program.cs" dotnet run --project "$temp_dir/$target_name.csproj" -- "$@" ;; + binary) + chmod +x ".run/src/bin/$target_name" + ".run/src/bin/$target_name" "$@" + ;; esac -- cgit