Skip to content

Commit 699d42a

Browse files
committed
simplify WP version detection in install script
1 parent 78d6861 commit 699d42a

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

tests/install-wp-tests.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,8 @@ download() {
2525
fi
2626
}
2727

28-
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then
29-
WP_BRANCH=${WP_VERSION%\-*}
30-
WP_TESTS_TAG="branches/$WP_BRANCH"
31-
32-
elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then
33-
WP_TESTS_TAG="branches/$WP_VERSION"
34-
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
35-
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
36-
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
37-
WP_TESTS_TAG="tags/${WP_VERSION%??}"
38-
else
39-
WP_TESTS_TAG="tags/$WP_VERSION"
40-
fi
41-
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
42-
WP_TESTS_TAG="trunk"
28+
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
29+
WP_TESTS_TAG="tags/$WP_VERSION"
4330
else
4431
# http serves a single offer, whereas https serves multiple. we only want one
4532
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json

0 commit comments

Comments
 (0)