#!/bin/bash
## Check if user already exists
wp user get customer 2> /dev/null
## if 0 is the exit code then we can leave otherwise we'll try creating the user
if [ $? -eq 0 ]
then
EXIT_CODE=0
else
wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer
EXIT_CODE=$?
fi
## set permalinks for easier wp-json
wp rewrite structure '/%postname%/'
wp rewrite flush
wp core version --extra
wp plugin list
exit $EXIT_CODE