Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/opencode/files/opencode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-gemini-auth"
]
}
21 changes: 14 additions & 7 deletions src/opencode/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
set -e

apt_get_update() {
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
}

# Checks if packages are installed and installs them if not
apt_get() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
apt-get -y install --no-install-recommends "$@"
fi
if ! dpkg -s "$@" >/dev/null 2>&1; then
apt-get -y install --no-install-recommends "$@"
fi
}

apt_get_update
Expand All @@ -26,3 +26,10 @@ curl -fsSL https://opencode.ai/install | bash

# Make opencode available for everybody
mv "$HOME/.opencode/bin/opencode" /usr/local/bin/opencode

OPENCODE_CONFIG_PATH="$_REMOTE_USER_HOME/.config/opencode"

# Create the global config
mkdir -p "$OPENCODE_CONFIG_PATH"
# Copy the configuration
cp -R files/* "$OPENCODE_CONFIG_PATH"