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