From 4f37a72d7ba5baf16f190cbfe075baf332ca96d5 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sat, 24 Jan 2026 16:54:54 -0600 Subject: [PATCH] Clean commands up --- cmd | 22 ++++++++++++++-------- framework/{cmd.d => common.d}/db | 0 framework/{cmd.d => common.d}/migrate | 0 framework/develop.d/db | 1 + framework/develop.d/migrate | 1 + framework/mgmt.d/db | 1 + framework/mgmt.d/migrate | 1 + 7 files changed, 18 insertions(+), 8 deletions(-) rename framework/{cmd.d => common.d}/db (100%) rename framework/{cmd.d => common.d}/migrate (100%) create mode 120000 framework/develop.d/db create mode 120000 framework/develop.d/migrate create mode 120000 framework/mgmt.d/db create mode 120000 framework/mgmt.d/migrate 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