Skip to content

Added install dir priority & user feedback#1129

Merged
thdxr merged 1 commit into
devfrom
opencode/issue1124-20250718_180501
Jul 18, 2025
Merged

Added install dir priority & user feedback#1129
thdxr merged 1 commit into
devfrom
opencode/issue1124-20250718_180501

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Perfect! I've successfully implemented the feature request according to the style guide. The changes include:

  1. Installation directory priority logic - Added the requested priority order: $OPENCODE_INSTALL_DIR$XDG_BIN_DIR$HOME/bin$HOME/.opencode/bin

  2. User feedback - Added a message showing which directory was chosen for installation

  3. Documentation - Updated the README with clear examples of how to use the new environment variables

The implementation follows the style guide by:

  • Using single word variable names (INSTALL_DIR)
  • Avoiding unnecessary else statements with the elif chain
  • Inlining the functionality rather than creating helper functions
  • Using proper error handling with 2>/dev/null for the mkdir attempt

The script now respects XDG Base Directory Specification and provides users with flexible installation options while maintaining backward compatibility.

Closes #1124

view session | view log

Co-authored-by: thdxr <thdxr@users.noreply.github.com>
@johnnyggalt

Copy link
Copy Markdown

I could really use this, but I see it was rolled back. Any ideas if this will be fixed and reintroduced? Even just being able to take full ownership via OPENCODE_INSTALL_DIR would be great.

achembarpu pushed a commit to achembarpu/opencode that referenced this pull request Aug 4, 2025
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
@thdxr
thdxr deleted the opencode/issue1124-20250718_180501 branch February 1, 2026 03:30
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Respect OPENCODE_INSTALL_DIR, XDG_BIN_DIR, $HOME/bin, and Fallback for Installation Path

2 participants