Skip to content

Commit

Permalink
feat: add support for sst v3
Browse files Browse the repository at this point in the history
  • Loading branch information
nurulhudaapon committed Aug 18, 2024
1 parent 43f2dd0 commit b212f0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ asdf plugin test sst https://github.com/nurulhudaapon/asdf-sst.git --asdf-tool-v
asdf plugin update sst canary

# Local Test Download
ASDF_DOWNLOAD_PATH="./dist" ASDF_INSTALL_VERSION=0.0.489 bash bin/download
ASDF_DOWNLOAD_PATH="./dist" ASDF_INSTALL_VERSION=3.0.42 bash bin/download

# Local Test Install
ASDF_DOWNLOAD_PATH="./dist" ASDF_INSTALL_VERSION=0.0.489 ASDF_INSTALL_PATH="./dist" ASDF_INSTALL_TYPE="version" bash bin/install
ASDF_DOWNLOAD_PATH="./dist" ASDF_INSTALL_VERSION=3.0.42 ASDF_INSTALL_PATH="./dist" ASDF_INSTALL_TYPE="version" bash bin/install
```

Tests are automatically run in GitHub Actions on push and PR.
6 changes: 5 additions & 1 deletion lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fail() {
exit 1
}

curl_opts=(-fsSL)
curl_opts=(-#fSL)

# NOTE: You might want to remove this if sst is not hosted on GitHub releases.
if [ -n "${GITHUB_API_TOKEN:-}" ]; then
Expand Down Expand Up @@ -51,6 +51,10 @@ download_release() {

echo -e "Downloading ${ORANGE}$TOOL_DISPLAY_NAME ${GREEN}version: ${YELLOW}$version ${GREEN}..."
url="$GH_REPO/releases/download/v${version}/${platform}.tar.gz"
# If version is 3+, use the new release URL without the 'v' prefix.
if [ "${version:0:1}" -ge 3 ]; then
url="$GH_REPO/releases/download/${version}/${platform}.tar.gz"
fi
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
}

Expand Down

0 comments on commit b212f0b

Please sign in to comment.