Commit 7507c704 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Modify entrypoint commands

- Add install-setup
- Rename db-setup -> database-setup
- Fix error if wp-config.php already existed
parent 2d5dd6fc
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -17,6 +17,13 @@ declare -a STATIC_PATTERNS=(

create_config()
{
	if [[ ! -e wp-config.php ]]; then
		:
	elif [[ x${1-} = x-f ]]; then
		rm wp-config.php
	else
		return 0
	fi
	wp config create \
		--extra-php \
		--skip-check \
@@ -29,11 +36,6 @@ create_config()
	END_CONFIG
}

db_setup()
{
	wp core install "$@"
}

setup() {
	# Update pre-installed components
	wp core update --minor
@@ -81,7 +83,8 @@ if [[ -e ${LANGUAGES_LIST:=/etc/wordpress/languages.txt} ]]; then
fi

case "$1" in
	db-setup) create_config && db_setup "${@:2}" ;;
	database-setup) create_config -f && wp core install "${@:2}" ;;
	install-setup) create_config && setup ;;
	collect-static) create_config && collect_static ;;
	php-fpm)
		create_config