diff --git a/cmd b/cmd index 0b6d49e..552a972 100755 --- a/cmd +++ b/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 [args...] set -eu DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +if [ $# -lt 1 ]; then + echo "Usage: ./cmd [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" "$@" diff --git a/framework/cmd.d/db b/framework/common.d/db similarity index 100% rename from framework/cmd.d/db rename to framework/common.d/db diff --git a/framework/cmd.d/migrate b/framework/common.d/migrate similarity index 100% rename from framework/cmd.d/migrate rename to framework/common.d/migrate diff --git a/framework/develop.d/db b/framework/develop.d/db new file mode 120000 index 0000000..0e89a26 --- /dev/null +++ b/framework/develop.d/db @@ -0,0 +1 @@ +../common.d/db \ No newline at end of file diff --git a/framework/develop.d/migrate b/framework/develop.d/migrate new file mode 120000 index 0000000..5f4d586 --- /dev/null +++ b/framework/develop.d/migrate @@ -0,0 +1 @@ +../common.d/migrate \ No newline at end of file diff --git a/framework/mgmt.d/db b/framework/mgmt.d/db new file mode 120000 index 0000000..0e89a26 --- /dev/null +++ b/framework/mgmt.d/db @@ -0,0 +1 @@ +../common.d/db \ No newline at end of file diff --git a/framework/mgmt.d/migrate b/framework/mgmt.d/migrate new file mode 120000 index 0000000..5f4d586 --- /dev/null +++ b/framework/mgmt.d/migrate @@ -0,0 +1 @@ +../common.d/migrate \ No newline at end of file