Choose and install latest version on 'aikup', instead of failing.

This commit is contained in:
KtorZ 2023-04-13 10:14:57 +02:00
parent ea83e80bf7
commit 4420e43bc4
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 11 additions and 2 deletions

View File

@ -33,7 +33,8 @@ main() {
done
if [ -z "$AIKUP_VERSION" ]; then
err "must specify a version"
AIKUP_VERSION=$(get_latest_release)
say "no version specified; installing latest: $AIKUP_VERSION"
fi
# Print the banner after successfully parsing args
@ -130,7 +131,15 @@ EOF
list_versions() {
say "available versions"
curl -sSL "https://api.github.com/repos/aiken-lang/aiken/tags" | grep -E '"name": "v' | sed 's/.*\(v[^"]*\)",.*/\1/'
curl -sSL "https://api.github.com/repos/aiken-lang/aiken/tags" |
grep -E '"name": "v' |
sed 's/.*\(v[^"]*\)",.*/\1/'
}
get_latest_release () {
curl --silent "https://api.github.com/repos/aiken-lang/aiken/releases/latest" |
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/'
}
say() {