Skip to content

Commit

Permalink
fix intialize.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Jul 14, 2024
1 parent c15056e commit e2dd7a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/bin/initialize.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash
set -e

npm run env run tests-wordpress "chmod -c ugo+w /var/www/html"
npm run env run tests-cli "wp rewrite structure '/%postname%/' --hard"
wp-env run tests-wordpress chmod -c ugo+w /var/www/html
wp-env run tests-cli wp rewrite structure '/%postname%/' --hard

status=0
npm run env run tests-cli "wp site list" || status=$?
wp-env run tests-cli wp site list || status=$?

if [ $status -eq 0 ]
then
echo "Multisite already initialized"
else
echo "Converting to multisite"
npm run env run tests-cli "wp core multisite-convert --title='Distributor Multisite'"
npm run env run tests-cli "wp user create second '[email protected]' --user_pass=password --role=administrator"
npm run env run tests-cli "wp site create --slug=second --title='Second Site' --email='[email protected]'"
npm run env run tests-cli "wp theme enable twentytwentyone --activate"
npm run env run tests-cli "wp theme enable twentytwentyone --url=localhost/second --activate"
npm run env run tests-cli "cp wp-content/plugins/distributor/tests/cypress/.htaccess .htaccess"
wp-env run tests-cli wp core multisite-convert --title='Distributor Multisite'
wp-env run tests-cli wp user create second '[email protected]' --user_pass=password --role=administrator
wp-env run tests-cli wp site create --slug=second --title='Second Site' --email='[email protected]'
wp-env run tests-cli wp theme enable twentytwentyone --activate
wp-env run tests-cli wp theme enable twentytwentyone --url=localhost/second --activate
wp-env run tests-cli cp wp-content/plugins/distributor/tests/cypress/.htaccess .htaccess
fi

0 comments on commit e2dd7a1

Please sign in to comment.