mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-06 01:03:32 +08:00
fix: resolve symlinks in install.sh for npm/bun bin usage
When installed via `npm install ecc-universal`, the `ecc-install` bin entry creates a symlink from the package manager's bin directory to install.sh. The old `$(dirname "$0")` resolved to the bin directory instead of the actual package directory, causing `cp` to fail with "cannot stat '.../rules/common/.'". Now follows the symlink chain with readlink before resolving SCRIPT_DIR. Fixes #199
This commit is contained in:
10
install.sh
10
install.sh
@@ -22,7 +22,15 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
# Resolve symlinks — needed when invoked as `ecc-install` via npm/bun bin symlink
|
||||||
|
SCRIPT_PATH="$0"
|
||||||
|
while [ -L "$SCRIPT_PATH" ]; do
|
||||||
|
link_dir="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
||||||
|
SCRIPT_PATH="$(readlink "$SCRIPT_PATH")"
|
||||||
|
# Resolve relative symlinks
|
||||||
|
[[ "$SCRIPT_PATH" != /* ]] && SCRIPT_PATH="$link_dir/$SCRIPT_PATH"
|
||||||
|
done
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
||||||
RULES_DIR="$SCRIPT_DIR/rules"
|
RULES_DIR="$SCRIPT_DIR/rules"
|
||||||
|
|
||||||
# --- Parse --target flag ---
|
# --- Parse --target flag ---
|
||||||
|
|||||||
Reference in New Issue
Block a user