Add a 'list' command to aikup.

This commit is contained in:
KtorZ 2023-04-13 10:04:24 +02:00
parent 0cda98a0d1
commit ea83e80bf7
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 22 additions and 13 deletions

View File

@ -17,6 +17,10 @@ main() {
--) shift; break;; --) shift; break;;
install) shift; AIKUP_VERSION=$1;; install) shift; AIKUP_VERSION=$1;;
-l|--list)
list_versions
exit 0
;;
-h|--help) -h|--help)
usage usage
exit 0 exit 0
@ -116,6 +120,7 @@ USAGE:
aikup <SUBCOMMAND> aikup <SUBCOMMAND>
OPTIONS: OPTIONS:
-l, --list List available versions
-h, --help Print help information -h, --help Print help information
SUBCOMMANDS: SUBCOMMANDS:
@ -123,6 +128,11 @@ SUBCOMMANDS:
EOF 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/'
}
say() { say() {
printf "aikup: %s\n" "$1" printf "aikup: %s\n" "$1"
} }
@ -157,21 +167,20 @@ ensure() {
banner() { banner() {
printf ' printf '
.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx ================================================================================
╔═╗ ╦ ╔╦ ║ ╔══ ╔╗╔ Modern and modular toolkit ░█▀▀▄░▀█▀░▒█░▄▀░▒█▀▀▀░▒█▄░▒█ Modern and modular toolkit
╠═╣ ║ ╠═╣ ╠═ ║║║ for Cardano Smart Contract Development ▒█▄▄█░▒█░░▒█▀▄░░▒█▀▀▀░▒█▒█▒█ for Cardano Smart Contract development.
╚ ╝ ╩ ╚ ╚ ╚══ ╝╚╝ written in Rust. ▒█░▒█░▄█▄░▒█░▒█░▒█▄▄▄░▒█░░▀█ Written in Rust.
.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx ================================================================================
Repo : https://github.com/aiken-lang/aiken Repo : https://github.com/aiken-lang/aiken
Docs : https://aiken-lang.org/ Docs : https://aiken-lang.org/
Chat : https://discord.gg/Vc3x8N9nz2 Chat : https://discord.gg/Vc3x8N9nz2
Contribute : https://github.com/aiken-lang/aiken/blob/main/CONTRIBUTING.md Contribute : https://github.com/aiken-lang/aiken/blob/main/CONTRIBUTING.md
.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx ================================================================================
' '
} }