Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Automatically increment Features version numbers using Drush

If you're serious about Drupal development, you probably use Drush and Features. If you do use Drush and Features, you will likely have caught yourself wishing to the Drupal Gods for the ability to automatically increment or set a feature's version number when updating it.

Well wish no more! The issue was actually created a while ago but just recently got implemented and comitted. It is now available in the Features 7.x-1.0-rc3 release!

There are 2 new options available for the features-update (fu) and features-export (fe) commands: version-set and version-increment.

1
2
3
4
56
7
# Update (re-export) the "foo" feature and set its version number.
drush fu foo --version-set=7.x-1.0-beta1
 
# Update the "foo" feature and automatically increment its feature number.'
# It works with alpha, beta and rc versions too!drush fu foo --version-increment
# foo's version becomes 7.x-1.0-beta2

That's it about it, hope you enjoyed!

Now go increment all your feature's version numbers, just because you can! :)

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web