diff --git a/bin/agent-browser b/bin/agent-browser index 9b14e8d..1dfe638 100755 --- a/bin/agent-browser +++ b/bin/agent-browser @@ -2,8 +2,19 @@ # Cross-platform launcher for agent-browser # Detects OS/arch and runs the appropriate native binary -# Get the directory where this script lives -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# Get the directory where this script lives (resolving symlinks) +SCRIPT="$0" +# Resolve symlinks +while [ -L "$SCRIPT" ]; do + SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)" + SCRIPT="$(readlink "$SCRIPT")" + # Handle relative symlinks + case "$SCRIPT" in + /*) ;; + *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;; + esac +done +SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)" # Detect platform OS="$(uname -s)"