Closed (cannot reproduce)
Project:
Drush
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Aug 2010 at 21:35 UTC
Updated:
14 May 2012 at 05:43 UTC
I'm testing a new drush command to automate a few tasks. The file I created is customc.drush.inc. My question: where do I save this file?
I tried saving it to one of the following folders
/drush/customc.drush.inc
/drush/commands/customc.drush.inc
Then called drush customc but it gives me a command not found error.
Is there a step I'm missing?
Comments
Comment #1
greg.1.anderson commented$HOME/.drush/customc.drush.inc is a good place.
Comment #2
bunoti commentedStrange, it gives command not found.
I'm working on Windows and have drush installed in C|drush, outside the Drupal installation and outside localhost altogether. Any suggestions what could be the problem? I'd like to try this command if I can only get it to take.
Comment #3
bunoti commentedComment #4
greg.1.anderson commentedPost your drush.inc file; maybe there is something wrong with it. [drush]/commands/customc.drush.inc isn't a great place to put your command files, but that should work.
Comment #5
bunoti commentedI doubt it's a problem with the command file itself. I experimented with Moshe's sandwich.drush.inc command and tried it at several locations and had the same behavior. When I try "drush sandwich", I get "The drush command 'sandwich' could not be found." Drush works fine, just not the custom commands.
Comment #6
greg.1.anderson commentedTake a look at the code in the function
_drush_find_commandfiles()in command.inc. Try adding$options['SHARE_PREFIX'] = 'C:'to your drushrc.php, then put your custom commands inC:/share/drush/commands. If that doesn't work, change the / to \ in the code and see if it works. If Windows needs the \s in the path, let me know here and I'll fiddle with it.Comment #7
vunger commentedDidn't work for me:
>drush make
$options['SHARE_PREFIX'] = 'C:'The drush command 'make' could not be found.
[error]
So I tried changing / to \. That didn't work either; the result was the same.
Comment #8
vunger commentedOops, forgot the <?php at the top of my drushrc.php file. Fixed that, now I'm getting:
C:\xampp\htdocs\droopal>drush make
Drush command could not be completed. ←[31;40m←[1
m[error]←[0m
Comment #9
vunger commentedComment #10
jonhattanUsing / or \ in windows doesn't matter. See: http://alanhogan.com/tips/php/directory-separator-not-necessary
btw, DIRECTORY_SEPARATOR is useful for path parsing (rtrim, explode,..) but not needed for path generation. Windows is powerful enough :p
@vunger: #8 seems a separate issue. Try --debug btw.
Comment #11
vunger commentedThanks, but I give up using drush make in Windows.
Comment #12
moshe weitzman commentedComment #13
alex.skrypnykFor future reference:
In case if your command is not picked up, delete 'cache' directory in '.drush', as drush caches commands list.