Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,19 @@ while [[ $# -gt 0 ]]; do
esac
done

INSTALL_DIR=$HOME/.opencode/bin
if [ -n "${OPENCODE_INSTALL_DIR:-}" ]; then
INSTALL_DIR=$OPENCODE_INSTALL_DIR
elif [ -n "${XDG_BIN_DIR:-}" ]; then
INSTALL_DIR=$XDG_BIN_DIR
elif [ -x "$HOME/.opencode/bin/opencode" ]; then
# Keep upgrading in place instead of silently moving an existing
# install to the newer $HOME/bin tier below.
INSTALL_DIR=$HOME/.opencode/bin
elif mkdir -p "$HOME/bin" 2>/dev/null; then
INSTALL_DIR=$HOME/bin
else
INSTALL_DIR=$HOME/.opencode/bin
fi
mkdir -p "$INSTALL_DIR"

# If --binary is provided, skip all download/detection logic
Expand Down
Loading