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"