Skip to content

Commit f9a5caf

Browse files
committed
Fix install.sh tag parsing for releases
1 parent 44907ed commit f9a5caf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,20 @@ VERSION="${VERSION#v}"
7777
if [[ -z "$VERSION" ]]; then
7878
tag="$(
7979
curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
80-
| sed -nE 's/^[[:space:]]*"tag_name":[[:space:]]*"([^"]+)".*$/\\1/p' \
80+
| sed -nE 's/^[[:space:]]*"tag_name":[[:space:]]*"([^"]+)".*$/\1/p' \
8181
| head -n 1
8282
)"
8383
if [[ -z "$tag" ]]; then
8484
echo "failed to resolve latest version from GitHub for ${REPO}" >&2
8585
exit 1
8686
fi
8787
VERSION="${tag#v}"
88+
else
89+
tag="v${VERSION}"
8890
fi
8991

9092
asset="nytgames-cli_${VERSION}_${os}_${arch}.tar.gz"
91-
base_url="https://github.com/${REPO}/releases/download/v${VERSION}"
93+
base_url="https://github.com/${REPO}/releases/download/${tag}"
9294
url="${base_url}/${asset}"
9395
checksums_url="${base_url}/checksums.txt"
9496

@@ -138,4 +140,3 @@ if ! command -v "${BIN_NAME}" >/dev/null 2>&1; then
138140
echo "Note: ${INSTALL_DIR} is not on your PATH. Add it, e.g.:" >&2
139141
echo " export PATH=\"${INSTALL_DIR}:\$PATH\"" >&2
140142
fi
141-

0 commit comments

Comments
 (0)