Clean commands up
This commit is contained in:
22
cmd
22
cmd
@@ -2,20 +2,26 @@
|
||||
|
||||
# This file belongs to the framework. You are not expected to modify it.
|
||||
|
||||
# FIXME: Obviously this file isn't nearly robust enough. Make it so.
|
||||
# Managed binary runner - runs framework-managed binaries like node, pnpm, tsx
|
||||
# Usage: ./cmd <command> [args...]
|
||||
|
||||
set -eu
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: ./cmd <command> [args...]"
|
||||
echo ""
|
||||
echo "Available commands:"
|
||||
for cmd in "$DIR"/framework/cmd.d/*; do
|
||||
if [ -x "$cmd" ]; then
|
||||
basename "$cmd"
|
||||
fi
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
subcmd="$1"
|
||||
|
||||
# echo "$subcmd"
|
||||
|
||||
#exit 3
|
||||
|
||||
shift
|
||||
|
||||
echo will run "$DIR"/framework/cmd.d/"$subcmd" "$@"
|
||||
|
||||
exec "$DIR"/framework/cmd.d/"$subcmd" "$@"
|
||||
|
||||
Reference in New Issue
Block a user