14 lines
336 B
Bash
14 lines
336 B
Bash
#!/usr/bin/env bash
|
|
|
|
SCRIPT_DIR="$(dirname $(realpath "$0"))"
|
|
|
|
function run() {
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: $0 <category> <script> [args...]"
|
|
find "$SCRIPT_DIR" -mindepth 2 -iname "*.sh" | awk -F'[./]' '{printf "$ run %s %s\n",$(NF-2),$(NF-1)}'
|
|
return
|
|
fi
|
|
bash "$SCRIPT_DIR/$1/$2.sh" ${@:3}
|
|
}
|
|
|