aboutsummaryrefslogtreecommitdiff
path: root/run-tools.sh
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-10 16:54:57 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-10 16:54:57 +0800
commit5d258482fb84d58c966a7ccc1b467708278d28ad (patch)
tree1a0c9d2e245d43ff7bc11d9088cf88a5264d293f /run-tools.sh
parenta8c8d50b6c59b103da7fd4bbb5e7ca3ff7b2f49a (diff)
refactor(devtools): rename dev_tools to .run and replace run-tools
scripts Replace the old run-tools.ps1/run-tools.sh scripts with a new unified run.ps1/run.sh launcher that supports multiple languages (PowerShell, Rust, Python, Go, C#, Nim, Perl, Ruby, Zig, and arbitrary binaries) from the `.run/src/bin` directory. Move all development tools from `dev_tools/` to `.run/`, update Cargo workspace config and relevant documentation references.
Diffstat (limited to 'run-tools.sh')
-rwxr-xr-xrun-tools.sh64
1 files changed, 0 insertions, 64 deletions
diff --git a/run-tools.sh b/run-tools.sh
deleted file mode 100755
index 9a68f0e..0000000
--- a/run-tools.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/bash
-
-cd "$(dirname "$0")" || exit 1
-
-# Collect all available tool names
-tools=()
-
-if [ -d "dev_tools/scripts" ]; then
- for file in dev_tools/scripts/*.sh; do
- if [ -f "$file" ]; then
- tools+=("$(basename "$file" .sh)")
- fi
- done
- for file in dev_tools/scripts/*.py; do
- if [ -f "$file" ]; then
- tools+=("$(basename "$file" .py)")
- fi
- done
-fi
-if [ -d "dev_tools/src/bin" ]; then
- for file in dev_tools/src/bin/*.rs; do
- if [ -f "$file" ]; then
- tools+=("$(basename "$file" .rs)")
- fi
- done
-fi
-
-if [ $# -eq 0 ]; then
- echo "Available:"
- for i in "${!tools[@]}"; do
- printf " [%2d] %s\n" $((i + 1)) "${tools[$i]}"
- done
- exit 1
-fi
-
-target_bin="$1"
-shift # Remove the first argument (tool name), keep the rest as tool arguments
-
-# Check if input is a number
-if [[ "$target_bin" =~ ^[0-9]+$ ]]; then
- idx=$((target_bin - 1))
- if [ "$idx" -ge 0 ] && [ "$idx" -lt "${#tools[@]}" ]; then
- target_bin="${tools[$idx]}"
- else
- echo "Error: invalid number '$target_bin', valid range is 1-${#tools[@]}"
- exit 1
- fi
-fi
-
-target_script="dev_tools/scripts/${target_bin}.sh"
-target_python="dev_tools/scripts/${target_bin}.py"
-target_file="dev_tools/src/bin/${target_bin}.rs"
-
-if [ -f "$target_script" ]; then
- chmod +x "$target_script"
- "$target_script" "$@"
-elif [ -f "$target_python" ]; then
- python "$target_python" "$@"
-elif [ -f "$target_file" ]; then
- cargo run --manifest-path dev_tools/Cargo.toml --bin "$target_bin" --quiet -- "$@"
-else
- echo "Error: target '$target_bin' does not exist"
- exit 1
-fi