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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: