Skip to content

Commit db841e7

Browse files
authored
Merge pull request #269 from docker-library/jq-IN
Use jq's `IN()` instead of `index()`
2 parents c33e782 + e43db23 commit db841e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

versions.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ releases="$(
6161
# add a key for the appropriate "X.Y" or "X.Y-rc" value
6262
| .folder = (.version | ([ split("[.-]"; "") | if .[0] == "7" then .[0] else .[0,1] end ] | join(".")) + if index("-") then "-rc" else "" end)
6363
# filter to *just* versions that the upstream file claims are actually supported ("supported_branches")
64-
| select((.folder | rtrimstr("-rc")) as $ver | $versions | index($ver) | not|not)
64+
| select((.folder | rtrimstr("-rc")) | IN($versions[]) | not|not)
6565
) as $rel ({}; .[$rel.version] = $rel)
6666
| to_entries
6767
# put all releases in sorted order
@@ -116,14 +116,14 @@ for version in "${versions[@]}"; do
116116
[
117117
# https://www.drupal.org/project/drupal/releases/10.2.0-rc1#php-deps
118118
# Drupal now supports PHP 8.3 and recommends at least PHP 8.2.
119-
if [ "7", "10.0" ] | index(env.version) then empty else
119+
if env.version | IN("7", "10.0") then empty else
120120
"8.3"
121121
end,
122122
# https://www.drupal.org/node/3413288 ("Drupal 11 will require PHP 8.3")
123-
if [ "7", "10.0", "10.2", "10.3" ] | index(env.version) then
123+
if env.version | IN("7", "10.0", "10.2", "10.3") then
124124
"8.2"
125125
else empty end,
126-
if [ "7", "10.0" ] | index(env.version) then
126+
if env.version | IN("7", "10.0") then
127127
"8.1"
128128
else empty end,
129129
# https://www.drupal.org/docs/system-requirements/php-requirements

0 commit comments

Comments
 (0)