From bf30dccf35127da9afb5de4a3f2935a2e019fb63 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:16:14 +0000 Subject: [PATCH 1/2] Initial plan From 7e63614de35d9da1ba1bcff5a2c5b6c8b94eea84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:19:44 +0000 Subject: [PATCH 2/2] Replace 'which' with 'command -v' for better portability Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- templates/install-wp-tests.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/install-wp-tests.sh b/templates/install-wp-tests.sh index 01260d55..0c7c1064 100644 --- a/templates/install-wp-tests.sh +++ b/templates/install-wp-tests.sh @@ -29,9 +29,9 @@ WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} WP_CORE_FILE="$WP_CORE_DIR"/wp-settings.php download() { - if [ `which curl` ]; then + if command -v curl > /dev/null 2>&1; then curl -L -s "$1" > "$2"; - elif [ `which wget` ]; then + elif command -v wget > /dev/null 2>&1; then wget -nv -O "$2" "$1" else echo -e "${RED}Error: Neither curl nor wget is installed.${RESET}" @@ -235,7 +235,7 @@ recreate_db() { if [[ $1 =~ ^(y|yes)$ ]] then echo -e "${CYAN}Recreating the database ($DB_NAME)...${RESET}" - if [ `which mariadb-admin` ]; then + if command -v mariadb-admin > /dev/null 2>&1; then mariadb-admin drop $DB_NAME -f --user="$DB_USER" --password="$DB_PASS"$EXTRA else mysqladmin drop $DB_NAME -f --user="$DB_USER" --password="$DB_PASS"$EXTRA @@ -249,7 +249,7 @@ recreate_db() { } create_db() { - if [ `which mariadb-admin` ]; then + if command -v mariadb-admin > /dev/null 2>&1; then mariadb-admin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA else mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA @@ -280,7 +280,7 @@ install_db() { fi # create database - if [ `which mariadb` ]; then + if command -v mariadb > /dev/null 2>&1; then local DB_CLIENT='mariadb' else local DB_CLIENT='mysql'