6

I was contemplating building a quick bash script to wget all of the modules I use on Drupal sites but every time the module version changes, the link changes.

Take for example the views module. At the time of writing it's at version 7.x-3.0-rc3 and therefore the link is as such http://ftp.drupal.org/files/projects/views-7.x-3.0-rc3.tar.gz

If I were to add this to my bash script it'd obviously stop working as soon as the next version is released.

Is there a URL which I can use with wget which will always give me the latest non dev version of a Drupal module.

[...]drupal.org/projects/views-7.x-stable.tar.gz for example

I don't want to use GIT or CVS etc as this will mean anyone using the script will need to install said program first. I would just like to be able to pass this script around to developers in my office to quickly download and deploy the latest Drupal version and modules we use constantly.

12

The latest stable is published on an XML file, so your script would need to query and parse it to get the proper URL. http://updates.drupal.org/release-history/project-list/all this returns ALL the projects release history, obviously very large. You can get a specific project with this URL http://updates.drupal.org/release-history/views/7.x where "views" is the project name and "7.x" is the version.

Or you could just use DRUSH. It's super easy to install and will make your life 100x easier and better. Drush is a command line PHP script that allows you to simply type things like drush dl views or drush up views. It can do a lot more too, it's truly amazing. http://drupal.org/project/drush

  • 5
    +1 for Drush. Why bother writing your own bash scripts if others have already done it? – marcvangend Nov 21 '11 at 16:05
  • I'd looked into Drush, but again, it's installing something. Ideally I just wanted a quick bash file full of wget commands and tar extract commands so that I don't have to roll out Drush onto client machines and development servers. If the xml file is the only list it's not worth me parsing it I guess. Drush may end up being my quickest option after all. – Ben Swinburne Nov 21 '11 at 16:18
  • 2
    I can't image not having drush on both development and deployed instances. – mpdonadio Nov 21 '11 at 16:35
  • 2
    I think if you used Drush a few times you'd drop your resistance mighty quickly. Most of us can't live without it. Also, you don't really "install" Drush, you just download it and make a link to it. WGET the drush URL, and then ln -s to it the folder. – Jonathan Rowny Nov 21 '11 at 18:29
  • Drush for President. – Lester Peabody May 1 '13 at 14:48
-1

Dave Hall has a blog post on this very subject, with excellent example code, at http://davehall.com.au/blog/dave/2010/02/22/check-drupal-module-status-using-bash

  • 2
    Normally, answers with litte more than links aren't considered good ones on Drupal Answers. Can you summarize the linked article? – mpdonadio May 1 '13 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.