Posts Tagged ‘make’

h1

Drupal Drush: Changing the output of pm-list into something which can go into an installation profile

February 22, 2011

I like the command line and so drush is a great tool I found when building sites in drupal: http://drush.ws

It has a plugin called drush_make which can be used with an installation profile to automatically download and install a drupal and associated modules

The following command passed through sed will get all the non-core modules from a drupal installation and their version numbers and output it formatted in the way it can go into a drush make installation profile file.

drush pm-list --no-core --status=enabled | sed -r 's/(.{35})(.{63})Module 6.x-(.*)/\2|\3/g' | sed -r 's/[^(]*\(([^)]*)[^|]*\|([^ ]*)/projects[\1][version] = \2/g'

Advertisements