Skip to content

Commit b5c3469

Browse files
authored
Fix OpenCode installation: switch from .zip to .tar.gz (#74)
1 parent c445806 commit b5c3469

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/opencode/install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ check_packages() {
2626
fi
2727
}
2828

29-
# Make sure we have curl, ca-certificates, and unzip
30-
check_packages curl ca-certificates unzip jq
29+
# Make sure we have curl, ca-certificates, and tar
30+
check_packages curl ca-certificates tar jq
3131

3232
echo "Installing OpenCode version: $OPENCODE_VERSION"
3333

@@ -96,7 +96,7 @@ resolve_latest_version_fallback() {
9696
fi
9797

9898
echo "Failed to resolve version from HTML, using known fallback version..." >&2
99-
echo "0.10.4" # Known recent version as last resort
99+
echo "1.0.107" # Known recent version as last resort
100100
return 1
101101
}
102102

@@ -114,8 +114,8 @@ else
114114
fi
115115

116116
# Construct download URL based on opencode's release pattern
117-
# Asset name format: opencode-{platform}-{arch}.zip
118-
ASSET_NAME="opencode-${PLATFORM}-${ARCH_SUFFIX}.zip"
117+
# Asset name format: opencode-{platform}-{arch}.tar.gz
118+
ASSET_NAME="opencode-${PLATFORM}-${ARCH_SUFFIX}.tar.gz"
119119
DOWNLOAD_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/v${OPENCODE_VERSION}/${ASSET_NAME}"
120120

121121
echo "Downloading OpenCode from: ${DOWNLOAD_URL}"
@@ -148,7 +148,7 @@ if [ ! -f "${ASSET_NAME}" ] || [ ! -s "${ASSET_NAME}" ]; then
148148
fi
149149

150150
echo "Extracting OpenCode..."
151-
unzip -q "${ASSET_NAME}"
151+
tar -xzf "${ASSET_NAME}"
152152

153153
# Find the binary in the extracted contents
154154
# The archive should contain the opencode binary

0 commit comments

Comments
 (0)