Skip to content

Commit d867757

Browse files
committed
Removes need to download latest to get version number
Replaces GITHUB_LATEST_VERSION with twig template variable
1 parent 92e68b1 commit d867757

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

templates/cli/install.sh.twig

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,7 @@ printSuccess() {
9191
downloadBinary() {
9292
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
9393

94-
printf "${GREEN}🚦 Fetching latest version ... ${NC}\n"
95-
res=$(curl -L -s -H 'Accept: application/json' https://github.com/$GITHUB_REPOSITORY_NAME/releases/latest)
96-
if [[ "$res" == *"error"* ]]; then
97-
printf "${RED}❌ There was an error. Try again later.${NC} \n"
98-
exit 1
99-
fi
100-
printSuccess
101-
102-
GITHUB_LATEST_VERSION=$( echo $res | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
94+
GITHUB_LATEST_VERSION="{{ sdk.version }}"
10395
GITHUB_FILE="{{ language.params.npmPackage }}-${OS}-${ARCH}"
10496
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
10597

0 commit comments

Comments
 (0)