diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-11 22:28:26 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-11 22:28:26 +0800 |
| commit | dc501290f7b25b72edf8c67555b5604ac5fc8a59 (patch) | |
| tree | b6c4064e46ddef919a561a846c9770f432f821d2 /run-tools.sh | |
| parent | d6f0e3f8f97a27a464d9610500c29fb817a2ef88 (diff) | |
Add dev tools to generate example documentation
Diffstat (limited to 'run-tools.sh')
| -rwxr-xr-x | run-tools.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/run-tools.sh b/run-tools.sh new file mode 100755 index 0000000..7bfcd29 --- /dev/null +++ b/run-tools.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cd "$(dirname "$0")" || exit 1 + +if [ $# -eq 0 ]; then + echo "Available:" + if [ -d "dev_tools/src/bin" ]; then + for file in dev_tools/src/bin/*.rs; do + if [ -f "$file" ]; then + basename "$file" .rs + fi + done + else + echo "Warning: dev_tools/src/bin directory does not exist" + fi + exit 1 +fi + +target_bin="$1" +target_file="dev_tools/src/bin/${target_bin}.rs" + +if [ ! -f "$target_file" ]; then + echo "Error: target file '$target_file' does not exist" + exit 1 +fi + +cargo run --manifest-path dev_tools/Cargo.toml --bin "$1" |
