Skip to content

Conversation

@opencode-agent
Copy link
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>
@thdxr thdxr merged commit 01e7dc2 into dev Jul 18, 2025
nipuna-perera pushed a commit to nipuna-perera/opencode that referenced this pull request Jul 26, 2025
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
@johnnyggalt
Copy link

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>
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

3 participants