Skip to content

Commit 862d6d6

Browse files
committed
Add opencode app
1 parent 3851148 commit 862d6d6

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

apps/opencode@x86_64

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
app_info() {
6+
utils:info "AI coding agent, built for the terminal"
7+
}
8+
9+
app_install() {
10+
local version="${1:-$(app_version)}"
11+
local package="${APP_NAME}-linux-x64.zip"
12+
13+
utils:get_file \
14+
"https://github.com/sst/opencode/releases/download/$version/$package" \
15+
"$SDD_TEMP_DIR/$package"
16+
utils:extract "$SDD_TEMP_DIR/$package"
17+
18+
app_remove
19+
20+
install -vD -m755 "$SDD_TEMP_DIR/$APP_NAME" "$SDD_BIN_DIR/$APP_NAME" >&2
21+
}
22+
23+
app_remove() {
24+
rm -vf "$SDD_BIN_DIR/$APP_NAME" >&2
25+
}
26+
27+
app_version() {
28+
utils:github_latest_release 'sst/opencode'
29+
}
30+
31+
SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
32+
33+
# shellcheck source=./_utils.sh
34+
source "$SCRIPT_DIR/_utils.sh"
35+
36+
utils:parser "$@"

0 commit comments

Comments
 (0)