From a401c455513751f55d0373844c3d0f0435461c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 26 Oct 2020 16:12:16 +0000 Subject: [PATCH 1/2] Turn of execution bit on scripts --- bin/install-wp-tests.sh | 16 +++++++--------- bin/refresh-wp-install-tests.sh | 0 2 files changed, 7 insertions(+), 9 deletions(-) mode change 100644 => 100755 bin/install-wp-tests.sh mode change 100644 => 100755 bin/refresh-wp-install-tests.sh diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh old mode 100644 new mode 100755 index f8db3cc..6a295fa --- a/bin/install-wp-tests.sh +++ b/bin/install-wp-tests.sh @@ -17,7 +17,7 @@ SKIP_DB_CREATE=${6-false} TMPDIR=${TMPDIR-/tmp} TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} -WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/} +WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} download() { if [ `which curl` ]; then @@ -64,10 +64,9 @@ install_wp() { mkdir -p $WP_CORE_DIR if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - mkdir -p $TMPDIR/wordpress-nightly - download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip - unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ - mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR + mkdir -p $TMPDIR/wordpress-trunk + svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress + mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR else if [ $WP_VERSION == 'latest' ]; then local ARCHIVE_NAME='latest' @@ -109,8 +108,8 @@ install_test_suite() { if [ ! -d $WP_TESTS_DIR ]; then # set up testing suite mkdir -p $WP_TESTS_DIR - svn co --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes - svn co --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data + svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes + svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data fi if [ ! -f wp-tests-config.php ]; then @@ -167,8 +166,7 @@ install_db() { fi # create database - # Overwritten to incorporate https://github.com/wp-cli/scaffold-command/pull/255. - if [ $(mysql --user="$DB_USER" --password="$DB_PASS" --execute='show databases;' | grep ^$DB_NAME$) ] + if [ $(mysql --user="$DB_USER" --password="$DB_PASS"$EXTRA --execute='show databases;' | grep ^$DB_NAME$) ] then echo "Reinstalling will delete the existing test database ($DB_NAME)" read -p 'Are you sure you want to proceed? [y/N]: ' DELETE_EXISTING_DB diff --git a/bin/refresh-wp-install-tests.sh b/bin/refresh-wp-install-tests.sh old mode 100644 new mode 100755 From 7c42cf2ced387ffed1d5d408d0aa971e18119616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 26 Oct 2020 16:13:36 +0000 Subject: [PATCH 2/2] Fix colors in refresh script --- bin/refresh-wp-install-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/refresh-wp-install-tests.sh b/bin/refresh-wp-install-tests.sh index 6605395..eb7266c 100755 --- a/bin/refresh-wp-install-tests.sh +++ b/bin/refresh-wp-install-tests.sh @@ -8,4 +8,4 @@ DIR="$( cd "$(dirname "$0")" || exit 1; pwd -P )" curl -s "$SRC" \ | sed $'2i\\\n# Notice: This file is pulled from the WP-CLI scaffold command,\\\n# and should not be modified directly.\n' \ > "$DIR/install-wp-tests.sh" \ - && echo "\033[0;32mbin/install-wp-tests.sh has been updated to match ${SRC}\033[0;0m" + && echo -e "\033[0;32mbin/install-wp-tests.sh has been updated to match ${SRC}\033[0;0m"