Commit d5e923a1 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add LANGUAGES config array

parent 5a9c6aae
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
set -eu
shopt -s nullglob globstar

declare -a THEMES=() PLUGINS=() LANGUAGES=()
declare DB_HOST DB_NAME DB_USER DB_PASS

create_config()
{
	wp config create \
@@ -17,22 +20,27 @@ create_config()
}

setup() {
	# Update pre-installed components
	wp core update --minor
	wp plugin install "${PLUGINS[@]}"
	wp theme install "${THEMES[@]}"
	wp plugin update --all
	wp theme update --all
	wp language core update
	wp language plugin update --all
	wp language theme update --all

	# Install configured components
	wp plugin install "${PLUGINS[@]}"
	wp theme install "${THEMES[@]}"
	wp language core install "${LANGUAGES[@]}"
	wp language plugin install --all "${LANGUAGES[@]}" || true
	wp language theme install --all "${LANGUAGES[@]}" || true

	find -name static -prune \
		-name uploads -prune \
		-o -type f -not -iname '*.php' \
		-exec install -vD '{}' 'static/{}' \;
}

declare -a THEMES=()
declare -a PLUGINS=()

for file in /etc/wordpress/*.conf /etc/wordpress/**/*.conf; do
	source ${file}
done
@@ -43,6 +51,9 @@ fi
if [[ -e ${THEMES_LIST:=/etc/wordpress/themes.txt} ]]; then
	THEMES+=( $(<${THEMES_LIST}) )
fi
if [[ -e ${LANGUAGES_LIST:=/etc/wordpress/languages.txt} ]]; then
	LANGUAGES+=( $(<${LANGUAGES_LIST}) )
fi

case "$1" in
	php-fpm)