From d710db956f601e589f805d20138b1dd0e358265a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 28 Jun 2024 12:32:39 +0200 Subject: [PATCH] New commands --- commands/web/config-inspector | 20 ++++++++++++++++++++ commands/web/upgrade-status | 15 +++++++++++++++ install.yaml | 2 ++ 3 files changed, 37 insertions(+) create mode 100755 commands/web/config-inspector create mode 100755 commands/web/upgrade-status diff --git a/commands/web/config-inspector b/commands/web/config-inspector new file mode 100755 index 0000000..9f08621 --- /dev/null +++ b/commands/web/config-inspector @@ -0,0 +1,20 @@ +#!/bin/sh +#ddev-generated + +## Description: Run the config_inspector module to check for invalid configuration in the site. +## Usage: config-inspector +## Example: ddev config-inspector + +# Check if the config_inspector module is enabled +if ! drush pm:list --type=module --status=enabled | grep -q "config_inspector"; then + echo "The config_inspector module is not enabled. Please enable it first." + echo "Run 'ddev drush en config_inspector' to enable the module." + exit 1 +fi + +if [ -f "${DDEV_COMPOSER_ROOT}"/config_inspector-baseline.json ]; then + echo "Using baseline file: ${DDEV_COMPOSER_ROOT}/config_inspector-baseline.json" + drush config:inspect --baseline="${DDEV_COMPOSER_ROOT}"/config_inspector-baseline.json --only-error --detail +else + drush config:inspect --only-error --detail +fi diff --git a/commands/web/upgrade-status b/commands/web/upgrade-status new file mode 100755 index 0000000..7552052 --- /dev/null +++ b/commands/web/upgrade-status @@ -0,0 +1,15 @@ +#!/bin/sh +#ddev-generated + +## Description: Check the compatibility of your site with the next major version of Drupal. +## Usage: upgrade-status +## Example: ddev upgrade-status + +# Check if the upgrade_status module is enabled +if ! drush pm:list --type=module --status=enabled | grep -q "upgrade_status"; then + echo "The upgrade_status module is not enabled. Please enable it first." + echo "Run 'ddev drush en upgrade_status' to enable the module." + exit 1 +fi + +drush upgrade_status:analyze --ignore-contrib --all diff --git a/install.yaml b/install.yaml index bd835d1..ee1384d 100644 --- a/install.yaml +++ b/install.yaml @@ -64,6 +64,8 @@ project_files: - commands/host/install-playwright - commands/host/playwright - commands/web/dump-test-database + - commands/web/config-inspector + - commands/web/upgrade-status - dpp/add-base-url.js # - docker-compose.addon-template.yaml # - some-directory/file1.txt