Skip to content

Commit

Permalink
Get rid of list_all_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Jul 24, 2023
1 parent 79f1093 commit 3c06c21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 3 additions & 1 deletion bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")")
# shellcheck source=../lib/utils.bash
source "${plugin_dir}/lib/utils.bash"

list_all_versions | sort_versions | xargs echo
# The releases response also includes all the assets, so we can just use that
# instead of querying the assets for each release separately
gh_query "releases" | get_versions | sort_versions | xargs echo
11 changes: 2 additions & 9 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,15 @@ get_versions() {

# Given a tag, list its scala-ammonite versions
list_assets() {
local tag release_id
tag="$1"
release_id=$(gh_query "releases/tags/$tag" |
local release_id
release_id=$(gh_query "releases/tags/$1" |
grep -oE '"id": [0-9]+' |
cut -d ':' -f 2 |
sed -E "s/(^ +)|\"//g" | # Trim
head -n 1)
gh_query "releases/$release_id/assets" | get_versions
}

list_all_versions() {
# The releases response also includes all the assets, so we can just use that
# instead of querying the assets for each release separately
gh_query "releases" | get_versions
}

download_release() {
local version filename tag url
version="$1"
Expand Down

0 comments on commit 3c06c21

Please sign in to comment.