From bacd0d464e8f9a9ebd854ac79ea2a9ee5e283878 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 10 Mar 2026 12:39:47 -0700 Subject: [PATCH] Default INSTALL_DIR to current directory instead of /usr/local/bin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When run by strawhub, INSTALL_DIR is set to the package directory. Remove sudo fallback — error out if target directory is not writable. Co-Authored-By: Claude Opus 4.6 --- strawpot_claude_code/install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/strawpot_claude_code/install.sh b/strawpot_claude_code/install.sh index 02070bf..237a284 100755 --- a/strawpot_claude_code/install.sh +++ b/strawpot_claude_code/install.sh @@ -12,9 +12,10 @@ case "$OS" in *) echo "Unsupported OS: $OS" >&2; exit 1 ;; esac -# Default install directory +# Default install directory — current working directory. +# When run by strawhub, INSTALL_DIR is set to the package directory. if [ -z "$INSTALL_DIR" ]; then - INSTALL_DIR="/usr/local/bin" + INSTALL_DIR="$(pwd)" fi # Detect architecture @@ -44,8 +45,8 @@ mkdir -p "$INSTALL_DIR" if [ -w "$INSTALL_DIR" ]; then mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}" else - echo "Moving to ${INSTALL_DIR} (requires sudo)..." - sudo mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}" + echo "Error: cannot write to ${INSTALL_DIR}" >&2 + exit 1 fi echo "Installed to ${INSTALL_DIR}/${BINARY_NAME}"