Skip to content

Commit 2495daf

Browse files
authored
Merge pull request #361 from wp-cli/copilot/sub-pr-356
2 parents ff6dc07 + 8f7c499 commit 2495daf

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

templates/install-wp-tests.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ install_test_suite() {
169169
archive_url="https://github.com/WordPress/wordpress-develop/archive/refs/tags/${ref}.tar.gz"
170170
fi
171171

172+
if [ -z "$ref" ]; then
173+
echo -e "${RED}Error:${RESET} Unable to determine git reference from WP_TESTS_TAG: $WP_TESTS_TAG"
174+
exit 1
175+
fi
176+
172177
download "${archive_url}" "$TMPDIR/wordpress-develop.tar.gz"
173178

174179
# Validate that the tarball was downloaded correctly before extracting
@@ -201,6 +206,12 @@ install_test_suite() {
201206
else
202207
ref=${WP_TESTS_TAG#tags/}
203208
fi
209+
210+
if [ -z "$ref" ]; then
211+
echo -e "${RED}Error:${RESET} Unable to determine git reference from WP_TESTS_TAG: $WP_TESTS_TAG"
212+
exit 1
213+
fi
214+
204215
download https://raw.githubusercontent.com/WordPress/wordpress-develop/${ref}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
205216
# remove all forward slashes in the end
206217
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")

0 commit comments

Comments
 (0)