File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,24 @@ phpVersions=( "${phpVersions[@]%/}" )
1212current=" $( curl -fsSL ' https://api.wordpress.org/core/version-check/1.7/' | jq -r ' .offers[0].current' ) "
1313sha1=" $( curl -fsSL " https://wordpress.org/wordpress-$current .tar.gz.sha1" ) "
1414
15- cliVersion= " $(
15+ cliPossibleVersions=( $(
1616 git ls-remote --tags ' https://github.com/wp-cli/wp-cli.git' \
1717 | sed -r ' s!^[^\t]+\trefs/tags/v([^^]+).*!\1!g' \
18- | tail -1
19- ) "
20- cliSha512=" $( curl -fsSL " https://github.com/wp-cli/wp-cli/releases/download/v${cliVersion} /wp-cli-${cliVersion} .phar.sha512" ) "
21-
22- echo " $current (CLI $cliVersion )"
18+ | sort --version-sort --reverse
19+ )
20+ )
21+ cliVersion=
22+ cliSha512=
23+ for cliPosVer in " ${cliPossibleVersions[@]} " ; do
24+ cliUrl=" https://github.com/wp-cli/wp-cli/releases/download/v${cliPosVer} /wp-cli-${cliPosVer} .phar.sha512"
25+ if cliSha512=" $( curl -fsSL " $cliUrl " 2> /dev/null) " ; then
26+ cliVersion=" $cliPosVer "
27+ break
28+ fi
29+ done
30+ echo " $current (CLI '$cliVersion ')"
31+ # make sure we get a cliVersion
32+ [ -n " $cliVersion " ]
2333
2434declare -A variantExtras=(
2535 [apache]=" $( < apache-extras.template) "
You can’t perform that action at this time.
0 commit comments