Skip to content

Commit 6404bd0

Browse files
ignore: more reliable install script, handle non prettified json responses (anomalyco#2745)
Co-authored-by: rekram1-node <[email protected]>
1 parent 75157e5 commit 6404bd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎install‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mkdir -p "$INSTALL_DIR"
4646

4747
if [ -z "$requested_version" ]; then
4848
url="https://github.com/sst/opencode/releases/latest/download/$filename"
49-
specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')
49+
specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p')
5050

5151
if [[ $? -ne 0 || -z "$specific_version" ]]; then
5252
echo -e "${RED}Failed to fetch version information${NC}"

0 commit comments

Comments
 (0)