Optimise further

This commit is contained in:
xZero707 2021-02-15 01:17:40 +01:00
parent 910f24dbcf
commit db04d0acf1

View File

@ -15,12 +15,6 @@ echo "> About to install defined plugins"
for PLUGIN_EXPR in ${PLUGIN_LIST}; do
IFS=':' read -ra PLUGIN <<<"${PLUGIN_EXPR}"
WP_PLUGIN_INSTALL_ARGS="${PLUGIN[0]}"
if [ -n "${PLUGIN[1]}" ]; then
WP_PLUGIN_INSTALL_ARGS="${WP_PLUGIN_INSTALL_ARGS} --version=${PLUGIN[1]}"
fi
PLUGIN_PATH="${WP_CONTENT_PATH}/plugins/${PLUGIN[0]}"
if [ -d "${PLUGIN_PATH}" ] || [ -f "${PLUGIN_PATH}.php" ]; then
@ -28,6 +22,12 @@ for PLUGIN_EXPR in ${PLUGIN_LIST}; do
continue
fi
WP_PLUGIN_INSTALL_ARGS="${PLUGIN[0]}"
if [ -n "${PLUGIN[1]}" ]; then
WP_PLUGIN_INSTALL_ARGS="${WP_PLUGIN_INSTALL_ARGS} --version=${PLUGIN[1]}"
fi
echo "> Installing plugin '${PLUGIN[0]}' version '${PLUGIN[1]}'"
wp plugin install ${WP_PLUGIN_INSTALL_ARGS}
done