#!/bin/sh # Exit if anything fails set -e # Copy the contrib migrate_upgrade module to core drupal_upgrade. echo 'Copy the migrate_upgrade module to core migrate_drupal_ui.' MIGRATE_UPGRADE_LOCATION=`drush dd migrate_upgrade` cp -R $MIGRATE_UPGRADE_LOCATION core/modules mv core/modules/migrate_upgrade core/modules/migrate_drupal_ui pushd core/modules/migrate_drupal_ui # Remove drush-only files, and git. echo 'Remove drush-only files, and git.' rm migrate_upgrade.drush.inc rm src/MigrateUpgradeDrushRunner.php rm src/DrushLogMigrateMessage.php rm -Rf .git # Rename the files. echo 'Rename the files.' for f in migrate_upgrade.*; do mv "$f" "`echo $f | sed s/migrate_upgrade/migrate_drupal_ui/`"; done # Put the shared trait into migrate_drupal. echo 'Put the shared trait into migrate_drupal.' mv src/MigrationCreationTrait.php ../migrate_drupal/src # Replace module name references (namespaces etc.) in all drupal_upgrade files. echo 'Replace module name references (namespaces etc.) in all migrate_drupal_ui files.' find . -name "?*.*" -exec sed -i.bak 's/migrate_upgrade/migrate_drupal_ui/g' {} \; # Fix up the trait. echo 'Fix up the trait.' sed -i.bak s/migrate_upgrade/migrate_drupal/g ../migrate_drupal/src/MigrationCreationTrait.php # and references to the trait echo ' and references to the trait' find . -name "?*.*" -exec sed -i.bak 's/migrate_drupal_ui\\MigrationCreationTrait/migrate_drupal\\MigrationCreationTrait/g' {} \; # Cleanup. echo 'Cleanup' find . -name "*.bak" -delete find ../migrate_drupal -name "*.bak" -delete # Return home. popd echo 'diff --git a/core/composer.json b/core/composer.json index dbe1db9..f88d372 100644 --- a/core/composer.json +++ b/core/composer.json @@ -101,6 +101,7 @@ "drupal/menu_ui": "self.version", "drupal/migrate": "self.version", "drupal/migrate_drupal": "self.version", + "drupal/migrate_drupal_ui": "self.version", "drupal/node": "self.version", "drupal/options": "self.version", "drupal/page_cache": "self.version",' | git apply