From 162294362f6cf3377bdfd4a9c8d214a154eca2e6 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 10 Mar 2026 12:39:50 -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_codex/install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/strawpot_codex/install.sh b/strawpot_codex/install.sh index 2e8850a..2546356 100644 --- a/strawpot_codex/install.sh +++ b/strawpot_codex/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}"