2

I have written a drush extension that runs some post_make operations.

It's all good when I run $ drush make normally.

I have also written a bash script, which with some arguments, perfoms also drush site-install and other file structure stuff. The problem is when I execute this script and bash runs my drush make, my extension and post_hook is not running.

I know it's more of a bash permissions/ownership thing or something, than a drush issue, but does anyone have an idea?

My extension lives in ~/.drush/extension.

I'm using drush 5.9 and this is the actual script.

1 Answer 1

1

Do you run the script as the same user that you run the drush make directly as? Or do you perhaps run the script from cron? Check to make sure that your $HOME environment variable is pointing to the expected directory; if $HOME is not set, then Drush will not find your commandfiles.

6
  • Thanks, $HOME var points to the correct location, also if I echo it from the script I get the correct location...what else to look for?
    – Pan Chrono
    Commented Oct 5, 2015 at 7:56
  • Does your Drush extension, or any Drush extension in the same directory, define any Drush commands? Put drush help commandname in your script, and see if Drush is finding the commandfile. If you don't have any commands, just download one, e.g. drush dl drushify Commented Oct 5, 2015 at 14:34
  • Project drushify (7.x-1.0) downloaded to /home/<user>/.drush/drushify.Same location as my extension, I can see drushify help from that location..
    – Pan Chrono
    Commented Oct 9, 2015 at 12:17
  • Run drush ev 'return drush_commandfile_list();' and see if it includes your commandfile. Also, you should do these operations both from the command line and from your script, and look for any variations in behavior. Commented Oct 9, 2015 at 16:31
  • That was useful. From both ends I get the same array containing my extension from /home/<user>/.drush/<extension>, drushify, and also the core extensions from /usr/share/drush/commands. Weird stuff - I can also verify that if I execute my drush-make from a bash alias, it will work (!) but still not working from the script :(
    – Pan Chrono
    Commented Oct 12, 2015 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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