File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change
1
+ http_get_stdout () {
2
+ local f="$(mktemp "ruby-build.http.XXXXXX")"
3
+ http get "$1" "$f"
4
+ cat "$f"
5
+ rm -f "$f"
6
+ }
7
+
1
8
sort_release_urls () {
2
9
# With release names like /^(jdk-)?24.1.0-dev-20240207_2228$/
3
10
# strip everything up to the last dash so we can use the date as the sort field.
@@ -14,11 +21,11 @@ find_asset_url () {
14
21
# The releases page hides assets behind an "expanded_assets" url
15
22
# so we gather those, sort them according to "sort_release_urls" and store
16
23
# them in an array to loop over next.
17
- IFS=$'\n' read -d '' -r -a assets_urls < <(http get "$releases_prefix" - | grep -oE "$releases_prefix/expanded_assets/[^\"]+" | $sort_release_urls)
24
+ IFS=$'\n' read -d '' -r -a assets_urls < <(http_get_stdout "$releases_prefix" | grep -oE "$releases_prefix/expanded_assets/[^\"]+" | $sort_release_urls)
18
25
19
26
# For each release look in the assets output for a download link to the specified filename.
20
27
for assets_url in "${assets_urls[@]}"; do
21
- path="$(http get "$assets_url" - | grep -m1 -oE "/$repo/releases/download/[^/]+/$filename")"
28
+ path="$(http_get_stdout "$assets_url" | grep -m1 -oE "/$repo/releases/download/[^/]+/$filename")"
22
29
if [[ -n "$path" ]]; then
23
30
echo "https://github.com/$path"
24
31
return 0
Original file line number Diff line number Diff line change
1
+ http_get_stdout () {
2
+ local f="$(mktemp "ruby-build.http.XXXXXX")"
3
+ http get "$1" "$f"
4
+ cat "$f"
5
+ rm -f "$f"
6
+ }
7
+
1
8
sort_release_urls () {
2
9
# With release names like /^(jdk-)?24.1.0-dev-20240207_2228$/
3
10
# strip everything up to the last dash so we can use the date as the sort field.
@@ -14,11 +21,11 @@ find_asset_url () {
14
21
# The releases page hides assets behind an "expanded_assets" url
15
22
# so we gather those, sort them according to "sort_release_urls" and store
16
23
# them in an array to loop over next.
17
- IFS=$'\n' read -d '' -r -a assets_urls < <(http get "$releases_prefix" - | grep -oE "$releases_prefix/expanded_assets/[^\"]+" | $sort_release_urls)
24
+ IFS=$'\n' read -d '' -r -a assets_urls < <(http_get_stdout "$releases_prefix" | grep -oE "$releases_prefix/expanded_assets/[^\"]+" | $sort_release_urls)
18
25
19
26
# For each release look in the assets output for a download link to the specified filename.
20
27
for assets_url in "${assets_urls[@]}"; do
21
- path="$(http get "$assets_url" - | grep -m1 -oE "/$repo/releases/download/[^/]+/$filename")"
28
+ path="$(http_get_stdout "$assets_url" | grep -m1 -oE "/$repo/releases/download/[^/]+/$filename")"
22
29
if [[ -n "$path" ]]; then
23
30
echo "https://github.com/$path"
24
31
return 0
You can’t perform that action at this time.
0 commit comments