diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6727489..09d2706 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,13 @@ jobs: os: - ubuntu-latest - macos-latest + hurl-version: + - 4.0.0 + - 4.1.0 runs-on: ${{ matrix.os }} steps: - name: asdf_plugin_test - uses: asdf-vm/actions/plugin-test@v1 + uses: asdf-vm/actions/plugin-test@v2 with: command: hurl --version + version: ${{ matrix.hurl-version }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7758aab..f787797 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install asdf dependencies - uses: asdf-vm/actions/install@v1 + uses: asdf-vm/actions/install@v2 - name: Run ShellCheck run: scripts/shellcheck.bash @@ -23,10 +23,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install asdf dependencies - uses: asdf-vm/actions/install@v1 + uses: asdf-vm/actions/install@v2 - name: List file to shfmt run: shfmt -f . diff --git a/bin/download b/bin/download index 0de0276..57b1189 100755 --- a/bin/download +++ b/bin/download @@ -14,11 +14,24 @@ uname_s="$(uname -s)" uname_m="$(uname -m)" os="" -case "$uname_s" in -Darwin) os="macos" ;; -Linux) os="linux" ;; -*) fail "OS not supported: $uname_s" ;; -esac +install_numeric_version=$(numeric_version "${ASDF_INSTALL_VERSION}") +if [ "${install_numeric_version}" -ge "$(numeric_version 4.1.0)" ]; then + if [ "$uname_m" = "arm64" ]; then + uname_m="aarch64" + fi + + case "$uname_s" in + Darwin) os="apple-darwin" ;; + Linux) os="unknown-linux-gnu" ;; + *) fail "OS not supported: $uname_s" ;; + esac +else + case "$uname_s" in + Darwin) os="macos" ;; + Linux) os="linux" ;; + *) fail "OS not supported: $uname_s" ;; + esac +fi release_file="${TOOL_NAME}-${ASDF_INSTALL_VERSION}-${uname_m}-${os}.tar.gz" # Download tar.gz file to the download directory diff --git a/lib/utils.bash b/lib/utils.bash index fc46a8d..294f0f6 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -33,6 +33,10 @@ list_all_versions() { list_github_tags } +numeric_version() { + echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }' +} + download_release() { local version filename url version="$1"