Skip to content

Instantly share code, notes, and snippets.

@esolitos
Last active October 27, 2016 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esolitos/fda4e162e5012e6e2951afd0b36a7487 to your computer and use it in GitHub Desktop.
Save esolitos/fda4e162e5012e6e2951afd0b36a7487 to your computer and use it in GitHub Desktop.
Migrate from drush make based to composer based websites
#!/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