From 86416e9a1805df0eaa8b37c5617bf11a4286c38d Mon Sep 17 00:00:00 2001 From: Aaron McHale Date: Fri, 27 Feb 2026 14:43:07 +0000 Subject: [PATCH 1/2] Write test to proove symlink handling fails --- tests/test-cli.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test-cli.sh b/tests/test-cli.sh index 8ba5fed..d956ac0 100755 --- a/tests/test-cli.sh +++ b/tests/test-cli.sh @@ -13,6 +13,7 @@ PROJECT_ROOT="$(dirname "$(dirname "$(realpath "$0")")")" cleanup() { rm "$PROJECT_ROOT/$TEST_CMD_PATH" || true rm "$PROJECT_ROOT/$HELP_TXT_PATH" || true + rm "$PROJECT_ROOT/tests/cli-symlink.sh" || true } trap cleanup EXIT @@ -45,6 +46,18 @@ cd .. echo "OK" echo +echo "Testing cli.sh as a symlink from tests directory, to proove that it can be run as a symlink from anywhere..." +cd tests +ln -s ../cli.sh ./cli-symlink.sh +OUT=$(./cli-symlink.sh) +if [[ "$OUT" != *"$TEST_CMD"* ]]; then + echo "FAIL: Test command $TEST_CMD not found when running cli.sh as a symlink from tests dir" + exit 1 +fi +cd .. +echo "OK" +echo + echo "Testing cli.sh list sub-command to check output..." OUT=$(./cli.sh list) if [[ "$OUT" != *"$TEST_CMD"* ]]; then From 35c58c3cb7c756c937eb2b7cf6475fe5b0b591a0 Mon Sep 17 00:00:00 2001 From: Aaron McHale Date: Fri, 27 Feb 2026 14:53:06 +0000 Subject: [PATCH 2/2] Fix failure --- cli.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli.sh b/cli.sh index f70f4ad..62e3db0 100755 --- a/cli.sh +++ b/cli.sh @@ -3,7 +3,7 @@ # Simple CLI wrapper that discovers scripts in the commands/ directory # Cd to the directory of this script, so it can be run from anywhere -cd "$(dirname "$0")" || exit 1 +cd "$(dirname "$(realpath "$0")")" || exit 1 # Color codes RESET="\e[0m"