Skip to content

Commit 3b6b578

Browse files
authored
Merge pull request #345 from mostafasoufi/main
2 parents 820581d + efdc0ae commit 3b6b578

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

templates/install-wp-tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ download() {
2222
curl -s "$1" > "$2";
2323
elif [ `which wget` ]; then
2424
wget -nv -O "$2" "$1"
25+
else
26+
echo "Error: Neither curl nor wget is installed."
27+
exit 1
28+
fi
29+
}
30+
31+
# Check if svn is installed
32+
check_svn_installed() {
33+
if ! command -v svn > /dev/null; then
34+
echo "Error: svn is not installed. Please install svn and try again."
35+
exit 1
2536
fi
2637
}
2738

@@ -64,6 +75,7 @@ install_wp() {
6475
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
6576
mkdir -p $TMPDIR/wordpress-trunk
6677
rm -rf $TMPDIR/wordpress-trunk/*
78+
check_svn_installed
6779
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
6880
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
6981
else
@@ -108,6 +120,7 @@ install_test_suite() {
108120
# set up testing suite
109121
mkdir -p $WP_TESTS_DIR
110122
rm -rf $WP_TESTS_DIR/{includes,data}
123+
check_svn_installed
111124
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
112125
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
113126
fi

0 commit comments

Comments
 (0)