Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Jul 15, 2021
1 parent 2556106 commit d1e3689
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eo pipefail

# shellcheck disable=SC1090
# shellcheck disable=SC1091
source "$(dirname "$0")/../lib/json.bash"

trap cleanup SIGINT SIGTERM ERR
Expand Down
18 changes: 10 additions & 8 deletions bin/list-all
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

set -Eeo pipefail
set -Eo pipefail

# shellcheck disable=SC1090
# shellcheck disable=SC1091
source "$(dirname "$0")/../lib/json.bash"

json=$(curl --fail --silent --location https://ziglang.org/download/index.json)
Expand All @@ -12,9 +12,11 @@ sort_versions() {
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
}

json_parse "$json" |
sed 's/^\[\(.*\)\].*$/\1/' |
grep -Eo '[0-9]+.[0-9]+.[0-9]+' |
uniq |
sort_versions |
xargs echo
list_all_versions() {
json_parse "$json" |
sed 's/^\[\(.*\)\].*$/\1/' |
grep -Eo '[0-9]+.[0-9]+.[0-9]+' |
uniq
}

list_all_versions | sort_versions | xargs echo

0 comments on commit d1e3689

Please sign in to comment.