Files
release-factory/opencode-workstation-builder/image/scripts/bootstrap-opencode-userland.sh
T
okxlin 0e089d3cc6 refactor: rename image from oh-my-opencode-runtime to opencode-workstation
- Rename directory: oh-my-opencode-builder/ → opencode-workstation-builder/
- Rename workflow: build-oh-my-opencode-runtime.yml → build-opencode-workstation.yml
- Update IMAGE_REPO default to opencode-workstation
- Update all path references in workflow and scripts
- Update OCI image title and description
- Preserve upstream npm package oh-my-opencode references
2026-05-08 00:21:22 +08:00

25 lines
835 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
: "${OPENCODE_NPM_PACKAGE:=opencode-ai}"
: "${CONTAINER_DATA:=/data}"
: "${OPENCODE_INSTALL_DIR:=${CONTAINER_DATA}/opencode}"
: "${OPENCODE_NPM_BIN_DIR:=${CONTAINER_DATA}/bin}"
mkdir -p "${OPENCODE_INSTALL_DIR}" "${OPENCODE_NPM_BIN_DIR}"
if command -v opencode >/dev/null 2>&1; then
echo "[bootstrap] opencode already available: $(opencode --version 2>/dev/null || echo unknown)"
exit 0
fi
echo "[bootstrap] installing ${OPENCODE_NPM_PACKAGE} into ${OPENCODE_INSTALL_DIR}"
npm install --prefix "${OPENCODE_INSTALL_DIR}" --global-style "${OPENCODE_NPM_PACKAGE}"
if [[ -x "${OPENCODE_INSTALL_DIR}/node_modules/.bin/opencode" ]]; then
ln -sf "${OPENCODE_INSTALL_DIR}/node_modules/.bin/opencode" "${OPENCODE_NPM_BIN_DIR}/opencode"
fi
command -v opencode >/dev/null 2>&1
opencode --version