Skip to content
Merged
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
11 changes: 11 additions & 0 deletions src/sandbox/opencode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
# SPDX-License-Identifier: MPL-2.0

function sandbox_setup_opencode() {
# If there is an opencode config then mount it into the container
#
# NOTE: older versions of opencode use config.json
if [ -f "$HOME/.config/opencode/config.json" ]; then
# Ensure parent of mounted opencode folder exists
# otherwise .config is root in the container
mkdir -p "$PERSIST_FOLDER/home/.config/opencode"

CONTAINER_RUN_ARGS+=(--volume="$HOME/.config/opencode/config.json":"$HOME/.config/opencode/config.json":ro)
fi

# If there is an opencode config then mount it into the container
if [ -f "$HOME/.config/opencode/opencode.json" ]; then
# Ensure parent of mounted opencode folder exists
Expand Down