From bb31e0e9349b822addf3d5d1cd1891562e9a7854 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Tue, 22 Apr 2025 22:46:15 +0100 Subject: [PATCH] Fix shellcheck issues in install-wp-tests.sh --- bin/install-wp-tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh index 1afde1b..010ef62 100755 --- a/bin/install-wp-tests.sh +++ b/bin/install-wp-tests.sh @@ -17,9 +17,9 @@ WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} download() { - if [ `which curl` ]; then + if [ $(which curl) ]; then curl -s "$1" > "$2"; - elif [ `which wget` ]; then + elif [ $(which wget) ]; then wget -nv -O "$2" "$1" fi } @@ -76,7 +76,7 @@ install_wp() { LATEST_VERSION=${WP_VERSION%??} else # otherwise, scan the releases and get the most up to date minor version of the major release - local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` + local VERSION_ESCAPED=$(echo $WP_VERSION | sed 's/\./\\\\./g'` LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $WP_CORE_DIR/wp-latest.json | sed 's/"version":"//' | head -1) fi if [[ -z "$LATEST_VERSION" ]]; then @@ -120,7 +120,7 @@ install_test_suite() { sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php - + if [ "$MULTISITE" = "true" ]; then sed $ioption "s:// define( 'WP_TESTS_MULTISITE', true );:define( 'WP_TESTS_MULTISITE', true );:" "$WP_TESTS_DIR"/wp-tests-config.php fi