Skip to content

Commit

Permalink
fix(install): choose file extension based upon running OS (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: Yegor Bayev <[email protected]>
  • Loading branch information
kodx and kodx authored Nov 28, 2024
1 parent 5948f44 commit e364f07
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ fi

set -uo pipefail

ARCHIVE_EXT='.tar.gz'

case "${RUNNER_OS}" in
macOS) OS=apple-darwin ;;
Windows) OS=pc-windows-msvc ;;
*) OS=unknown-linux-gnu ;;
macOS)
OS=apple-darwin
;;
Windows)
OS=pc-windows-msvc
ARCHIVE_EXT='.zip'
;;
*)
OS=unknown-linux-gnu
;;
esac
case "${RUNNER_ARCH}" in
ARM64) ARCH=aarch64 ;;
Expand Down Expand Up @@ -40,7 +49,7 @@ else
fi

TAG_NAME="$(echo "${RELEASE_INFO}" | jq --raw-output ".tag_name")"
TARGET="git-cliff-${TAG_NAME:1}-${ARCH}-${OS}.tar.gz"
TARGET="git-cliff-${TAG_NAME:1}-${ARCH}-${OS}${ARCHIVE_EXT}"
LOCATION="$(echo "${RELEASE_INFO}" |
jq --raw-output ".assets[].browser_download_url" |
grep "${TARGET}$")"
Expand Down

0 comments on commit e364f07

Please sign in to comment.