From c0409579ac2d5cb82fa8477295c15e020bd78af1 Mon Sep 17 00:00:00 2001 From: Taylor Eernisse Date: Sat, 7 Feb 2026 14:06:50 -0500 Subject: [PATCH] Fix symlink resolution for SCRIPT_DIR in both scripts Scripts now resolve symlinks before computing SCRIPT_DIR, so they work correctly when invoked via ~/.local/bin/ symlinks. Co-Authored-By: Claude Opus 4.6 --- bin/plan-refine | 9 ++++++++- bin/plan-status | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/plan-refine b/bin/plan-refine index dfbef75..2aa0997 100755 --- a/bin/plan-refine +++ b/bin/plan-refine @@ -4,7 +4,14 @@ set -euo pipefail -SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +# Resolve symlinks to find real script location +SOURCE="${BASH_SOURCE[0]}" +while [[ -L "$SOURCE" ]]; do + DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" +done +SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")/.." && pwd)" PROMPTS_DIR="$SCRIPT_DIR/prompts" source "$SCRIPT_DIR/lib/frontmatter.sh" diff --git a/bin/plan-status b/bin/plan-status index 16e3831..6c28755 100755 --- a/bin/plan-status +++ b/bin/plan-status @@ -4,7 +4,14 @@ set -euo pipefail -SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +# Resolve symlinks to find real script location +SOURCE="${BASH_SOURCE[0]}" +while [[ -L "$SOURCE" ]]; do + DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" +done +SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")/.." && pwd)" source "$SCRIPT_DIR/lib/frontmatter.sh" SEARCH_ROOT="${HOME}/projects"