Last active
October 27, 2016 13:45
-
-
Save esolitos/fda4e162e5012e6e2951afd0b36a7487 to your computer and use it in GitHub Desktop.
Migrate from drush make based to composer based websites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Argument 1: Source drush-based drupal | |
# Argument 2: Destination composer-based drupal | |
# | |
OLD_ROOT=$1 | |
NEW_ROOT=$2 | |
if [ ! -d "$OLD_ROOT" ]; then | |
echo "Source directory not found!" | |
exit -1 | |
fi | |
if [ ! -d "$NEW_ROOT" ]; then | |
echo "Destination directory not found!" | |
exit -1 | |
fi | |
MODULES="$(drush -r $OLD_ROOT pml --status=enabled --type=module --no-core --pipe --no-field-labels)" | |
for drupal_module in $MODULES; do | |
echo "Require module: $drupal_module" | |
composer --working-dir="$NEW_ROOT" --quiet require -- "drupal/$drupal_module" | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment