Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid downloading first in english, and then switching language. #19

Merged
merged 1 commit into from Oct 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions provision/vvv-init.sh
Expand Up @@ -7,6 +7,7 @@ echo " * Custom site template provisioner - downloads and installs a copy of WP
DOMAIN=`get_primary_host "${VVV_SITE_NAME}".test`
SITE_TITLE=`get_config_value 'site_title' "${DOMAIN}"`
WP_VERSION=`get_config_value 'wp_version' 'latest'`
WP_LOCALE=`get_config_value 'locale' 'en_US'`
WP_TYPE=`get_config_value 'wp_type' "single"`
DB_NAME=`get_config_value 'db_name' "${VVV_SITE_NAME}"`
DB_NAME=${DB_NAME//[\\\/\.\<\>\:\"\'\|\?\!\*-]/}
Expand All @@ -29,7 +30,7 @@ if [ "${WP_TYPE}" != "none" ]; then
# Install and configure the latest stable version of WordPress
if [[ ! -f "${VVV_PATH_TO_SITE}/public_html/wp-load.php" ]]; then
echo "Downloading WordPress..."
noroot wp core download --version="${WP_VERSION}"
noroot wp core download --locale="${WP_LOCALE}" --version="${WP_VERSION}"
fi

if [[ ! -f "${VVV_PATH_TO_SITE}/public_html/wp-config.php" ]]; then
Expand Down Expand Up @@ -103,10 +104,4 @@ if [ ! -z "${WP_PLUGINS}" ]; then
done
fi

WP_LOCALE=`get_config_value 'locale' ''`
if [ ! -z "${WP_LOCALE}" ]; then
noroot wp language core install "${WP_LOCALE}" 2>/dev/null
noroot wp site switch-language "${WP_LOCALE}" 2>/dev/null
fi

echo "Site Template provisioner script completed"