Skip to content

Commit

Permalink
Merge pull request #345 from mostafasoufi/main
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Sep 16, 2024
2 parents 820581d + efdc0ae commit 3b6b578
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions templates/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ download() {
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
else
echo "Error: Neither curl nor wget is installed."
exit 1
fi
}

# Check if svn is installed
check_svn_installed() {
if ! command -v svn > /dev/null; then
echo "Error: svn is not installed. Please install svn and try again."
exit 1
fi
}

Expand Down Expand Up @@ -64,6 +75,7 @@ install_wp() {
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-trunk
rm -rf $TMPDIR/wordpress-trunk/*
check_svn_installed
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
else
Expand Down Expand Up @@ -108,6 +120,7 @@ install_test_suite() {
# set up testing suite
mkdir -p $WP_TESTS_DIR
rm -rf $WP_TESTS_DIR/{includes,data}
check_svn_installed
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
Expand Down

0 comments on commit 3b6b578

Please sign in to comment.