Skip to content

Commit

Permalink
add arch and os
Browse files Browse the repository at this point in the history
  • Loading branch information
jylenhof committed Mar 11, 2024
1 parent d5ed68b commit ab4d350
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,36 @@ list_all_versions() {
list_github_tags
}

get_arch() {
uname -m
}

get_os() {
local getos
getos="$(uname -s)"
case "${getos}" in
"Linux")
echo "unknown-linux-gnu"
;;
"Darwin")
echo "apple-darwin"
;;
*)
exit 1
;;
esac
}


download_release() {
local version filename url
version="$1"
filename="$2"

# TODO: Adapt the release URL convention for git-cliff
url="$GH_REPO/releases/download/v${version}/git-cliff-${version}-${arch}-{os}.tar.gz"
arch="$(get_arch)"
os="$(get_os)"

url="$GH_REPO/releases/download/v${version}/git-cliff-${version}-${arch}-${os}.tar.gz"

echo "* Downloading $TOOL_NAME release $version..."
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
Expand Down

0 comments on commit ab4d350

Please sign in to comment.