Skip to content

Commit

Permalink
--dev should enable/disable debug mode for WordPress
Browse files Browse the repository at this point in the history
  • Loading branch information
demyxco committed Mar 7, 2024
1 parent 5e25da5 commit 9ba3c32
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions function/config.sh
Expand Up @@ -683,6 +683,18 @@ demyx_config_dev() {
fi

} > "$DEMYX_CONFIG_TRANSIENT"

if [[ "$DEMYX_APP_STACK" = nginx-php || "$DEMYX_APP_STACK" = ols ]]; then
docker exec "$DEMYX_APP_WP_CONTAINER" bash -c "sed -i \"s|'WP_DEBUG',.*|'WP_DEBUG', true );|g\" ${DEMYX}/wp-config.php"
elif [[ "$DEMYX_APP_STACK" = bedrock || "$DEMYX_APP_STACK" = ols-bedrock ]]; then
docker exec "$DEMYX_APP_WP_CONTAINER" bash -c "sed -i \"s|WP_ENV=.*|WP_ENV=development|g\" ${DEMYX}/.env"
fi
elif [[ "$DEMYX_CONFIG_FLAG_DEV" = false ]]; then
if [[ "$DEMYX_APP_STACK" = nginx-php || "$DEMYX_APP_STACK" = ols ]]; then
docker exec "$DEMYX_APP_WP_CONTAINER" bash -c "sed -i \"s|'WP_DEBUG',.*|'WP_DEBUG', false );|g\" ${DEMYX}/wp-config.php"
elif [[ "$DEMYX_APP_STACK" = bedrock || "$DEMYX_APP_STACK" = ols-bedrock ]]; then
docker exec "$DEMYX_APP_WP_CONTAINER" bash -c "sed -i \"s|WP_ENV=.*|WP_ENV=production|g\" ${DEMYX}/.env"
fi
fi
}
#
Expand Down

0 comments on commit 9ba3c32

Please sign in to comment.