GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added install dir priority & user feedback (#1129) · Krule/opencode@01e7dc2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • README.md
  • install
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ paru -S opencode-bin # Arch Linux
3333
> [!TIP]
3434
> Remove versions older than 0.1.x before installing.
3535
36+
#### Installation Directory
37+
38+
The install script respects the following priority order for the installation path:
39+
40+
1. `$OPENCODE_INSTALL_DIR` - Custom installation directory
41+
2. `$XDG_BIN_DIR` - XDG Base Directory Specification compliant path
42+
3. `$HOME/bin` - Standard user binary directory (if exists or can be created)
43+
4. `$HOME/.opencode/bin` - Default fallback
44+
45+
```bash
46+
# Examples
47+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
48+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
49+
```
50+
3651
### Documentation
3752

3853
For more info on how to configure opencode [**head over to our docs**](https://opencode.ai/docs).
Collapse file

‎install‎

Copy file name to clipboardExpand all lines: install
+13-1Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,21 @@ case "$filename" in
4141
;;
4242
esac
4343

44-
INSTALL_DIR=$HOME/.opencode/bin
44+
# Determine installation directory with priority order
45+
if [ -n "${OPENCODE_INSTALL_DIR:-}" ]; then
46+
INSTALL_DIR="$OPENCODE_INSTALL_DIR"
47+
elif [ -n "${XDG_BIN_DIR:-}" ]; then
48+
INSTALL_DIR="$XDG_BIN_DIR"
49+
elif [ -d "$HOME/bin" ] || mkdir -p "$HOME/bin" 2>/dev/null; then
50+
INSTALL_DIR="$HOME/bin"
51+
else
52+
INSTALL_DIR="$HOME/.opencode/bin"
53+
fi
54+
4555
mkdir -p "$INSTALL_DIR"
4656

57+
print_message info "Installing to: ${YELLOW}$INSTALL_DIR${GREEN}"
58+
4759
if [ -z "$requested_version" ]; then
4860
url="https://github.com/sst/opencode/releases/latest/download/$filename"
4961
specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.