Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
xanmanning committed Mar 18, 2024
1 parent e484fad commit f3eb77d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ sort_versions() {

list_github_tags() {
git ls-remote --tags --refs "$GH_REPO" |
grep -v "chart-" |
grep -o 'refs/tags/.*' | cut -d/ -f3- |
sed 's/^v//' # NOTE: You might want to adapt this sed to remove non-version strings from tags
}
Expand All @@ -37,12 +38,29 @@ list_all_versions() {
}

download_release() {
local version filename url
local suffix version filename url platform arch
version="$1"
filename="$2"
platform="$3"
arch="$4"
suffix=""

case $platform in
"darwin")
suffix="-${platform}-${arch}"
;;
"windows")
suffix="-${platform}"
;;
*)
if [ "$platform" != "386" ]; then
suffix="-${arch}"
fi
;;
esac

# TODO: Adapt the release URL convention for k3kcli
url="$GH_REPO/archive/v${version}.tar.gz"
url="${GH_REPO}/releases/download/v${version}/${TOOL_NAME}${suffix}"

echo "* Downloading $TOOL_NAME release $version..."
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit f3eb77d

Please sign in to comment.