v0.0.1
This commit is contained in:
22
app.sh
Executable file
22
app.sh
Executable 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
|
||||
Reference in New Issue
Block a user