File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,25 @@ set -euo pipefail
4
4
5
5
VERSION=$1
6
6
7
- # Empty string means get latest, leave it empty
8
- if [[ -z " ${VERSION} " ]]; then
9
- TAG=" "
10
- # The tag is the version prefixed with a 'v' (if not already provided)
11
- elif [[ ! ${VERSION} =~ ^v.* ]]; then
12
- TAG=" v${VERSION} "
13
- else
14
- TAG=" ${VERSION} "
15
- fi
7
+ # If a version was set, do some massaging
8
+ if [[ -n " ${VERSION} " ]]; then
9
+ # The tag is the version prefixed with a 'v' (if not already provided)
10
+ if [[ ! ${VERSION} =~ ^v.* ]]; then
11
+ TAG=" v${VERSION} "
12
+ else
13
+ TAG=" ${VERSION} "
14
+ fi
16
15
17
- # If the version is 0.16.2 or greater, the tag is prefixed with knope/
18
- if [[ ${TAG} == " v0.16.2" || ${TAG} > " v0.16.2" ]]; then
19
- TAG=" knope/${TAG} "
16
+ # If the version is 0.16.2 or greater, the tag is prefixed with knope/
17
+ if [[ ${TAG} == " v0.16.2" || ${TAG} > " v0.16.2" ]]; then
18
+ TAG=" knope/${TAG} "
19
+ fi
20
+ else # If the tag is empty, get the latest release
21
+ TAG=$( gh release list --json tagName --jq ' .[].tagName' --repo " knope-dev/knope" | grep knope | head -n 1)
20
22
fi
21
23
22
24
# Use the GitHub CLI to download
23
-
25
+ echo " Downloading ${TAG} "
24
26
gh release download " ${TAG} " --repo " knope-dev/knope" --pattern " *linux*"
25
27
TAR_FILE=$( ls knope-* .tgz)
26
28
tar -xvf " $TAR_FILE "
You can’t perform that action at this time.
0 commit comments