Skip to content

Commit 290924e

Browse files
authored
fix(opencode.ai): improve install robustness and test coverage (#273)
1 parent f24e62c commit 290924e

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
| [nixos.org](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/nixos.org) | `nix` — the Nix package manager | curl | 1.0.2 |
7373
| [nvidia.com/cuda](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/nvidia.com-cuda) | NVIDIA CUDA Toolkit for GPU computing | curl | 1.0.2 |
7474
| [onecli.sh/cli](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/onecli.sh-cli) | `onecli` — manage agents, secrets, rules, and configuration from the terminal | gh release | 1.0.3 |
75-
| [opencode.ai](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/opencode.ai) | `opencode` — AI coding agent in the terminal | gh release | 1.0.6 |
75+
| [opencode.ai](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/opencode.ai) | `opencode` — AI coding agent in the terminal | gh release | 1.0.7 |
7676
| [pi.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/pi.dev) | `pi` — minimal terminal coding harness | gh release | 1.0.3 |
7777
| [pkgx.sh](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/pkgx.sh) | `pkgx` — run any package without installing | curl | 1.0.2 |
7878
| [pulumi.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/pulumi.com) | `pulumi` — infrastructure as code in any language | gh release | 1.0.3 |

src/opencode.ai/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opencode.ai",
33
"id": "opencode.ai",
4-
"version": "1.0.6",
4+
"version": "1.0.7",
55
"description": "Install \"opencode\" binary",
66
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/opencode.ai",
77
"options": {

src/opencode.ai/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ curl_download_tarball() {
7373
rm "$temp_file"
7474
}
7575
debian_get_arch() {
76+
local arch
7677
arch=$(uname -m)
7778
if [[ "$arch" == "aarch64" ]]; then
78-
arch="arm64"
79+
arch="arm64"
7980
elif [[ "$arch" == "x86_64" ]]; then
80-
arch="x64"
81+
arch="x64"
8182
fi
8283
echo "$arch"
83-
# echo "$(dpkg --print-architecture)" --- IGNORE ---
8484
}
8585
echo_banner() {
8686
local text="$1"
@@ -140,6 +140,7 @@ install() {
140140
readonly binaryTargetPath="${binaryTargetFolder}/${binaryName}"
141141
curl_download_tarball "$downloadUrl" "$binaryTargetFolder"
142142
chmod 755 "$binaryTargetPath"
143+
apt_get_cleanup
143144
}
144145
echo_banner "devcontainer.community"
145146
echo "Installing $name..."

test/opencode.ai/test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ source dev-container-features-test-lib
1212
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
1313
# check <LABEL> <cmd> [args...]
1414

15-
# check "execute command" bash -c "opencode"
16-
check "check existence" bash -c "ls -lah /usr/local/bin/opencode"
15+
check "check version output" bash -c "opencode --version"
1716

1817
# Report results
1918
# If any of the checks above exited with a non-zero exit code, the test will fail.

0 commit comments

Comments
 (0)