Skip to content

Commit 4bae878

Browse files
juhgiyoclaude
andauthored
Default INSTALL_DIR to current directory (#14)
## Summary - Default `INSTALL_DIR` to `$(pwd)` instead of `/usr/local/bin` - When run by strawhub, `INSTALL_DIR` is already set to the package directory - Remove sudo fallback — error out if target is not writable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 23a5d76 commit 4bae878

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

strawpot_claude_code/install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ case "$OS" in
1212
*) echo "Unsupported OS: $OS" >&2; exit 1 ;;
1313
esac
1414

15-
# Default install directory
15+
# Default install directory — current working directory.
16+
# When run by strawhub, INSTALL_DIR is set to the package directory.
1617
if [ -z "$INSTALL_DIR" ]; then
17-
INSTALL_DIR="/usr/local/bin"
18+
INSTALL_DIR="$(pwd)"
1819
fi
1920

2021
# Detect architecture
@@ -44,8 +45,8 @@ mkdir -p "$INSTALL_DIR"
4445
if [ -w "$INSTALL_DIR" ]; then
4546
mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}"
4647
else
47-
echo "Moving to ${INSTALL_DIR} (requires sudo)..."
48-
sudo mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}"
48+
echo "Error: cannot write to ${INSTALL_DIR}" >&2
49+
exit 1
4950
fi
5051

5152
echo "Installed to ${INSTALL_DIR}/${BINARY_NAME}"

0 commit comments

Comments
 (0)