Skip to content

Commit

Permalink
Fix get extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sarg3nt committed May 25, 2024
1 parent 89fc884 commit 10ff0ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
plugin_test:
name: asdf plugin test
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
Expand Down
19 changes: 8 additions & 11 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,18 @@ get_platform() {
echo "$platform"
}

get_extension() {
local platform
platform="$1"
download_release() {
local version filename url platform extension
version="$1"
platform=$(get_platform)
if [ "${platform:-x}" = "win64" ] || [ "${platform:-x}" = "win32" ]; then
echo='zip'
extension='zip'
else
echo='tar.gz'
extension='tar.gz'
fi
}

download_release() {
local version filename url
version="$1"
local -r platform=$(get_platform)
local -r extension=$(get_extension "$platform")
echo "Platform: $platform"
echo "Extension: $extension"

#'https://github.com/zyedidia/micro/releases/download/v$version/micro-$version-$platform.$extension'
url="$GH_REPO/releases/download/v${version}/micro-${version}-${platform}.${extension}"
Expand Down

0 comments on commit 10ff0ad

Please sign in to comment.