This commit is contained in:
姜永春
2025-11-24 10:10:56 +08:00
parent 2f6c95deb4
commit 95c179787c
4 changed files with 112 additions and 10 deletions

22
app-old.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# 环境变量
APP_DIR=$(cd "$(dirname "$0")" && pwd)
# 执行命令
if [ -f "$APP_DIR/cmds/app-$1.sh" ]; then
. "$APP_DIR/cmds/app-$1.sh"
else
echo "Error: usage: ./app.sh <command>"
echo "commands:"
if [ -d "$APP_DIR/cmds" ]; then
for file in "$APP_DIR"/cmds/app-*.sh; do
if [ -f "$file" ]; then
filename=$(basename "$file")
cmd_name=${filename#app-}
cmd_name=${cmd_name%.sh}
echo " $cmd_name"
fi
done
fi
fi