Hi, I just upgraded to drush 7.x-4.x (I don't know from which version I came, sorry) and my %drush path alias for drush on the remote server was not recognised anymore.

I had the following in my aliases definition:

$aliases['foo'] = array(
  // ...
  'path-aliases' => array(
    '%drush' => '/path/to/drush/',
  ),
);

Doing "drush @foo status" gave me "drush: command not found" and when running in debug mode, the command executed on remote is "drush" instead of the absolute path ("/path/to/drush/drush") I expected.

After some digging around in the drush files, I found out that I have to set the path-alias '%drush-script':

$aliases['foo'] = array(
  // ...
  'path-aliases' => array(
    '%drush-script' => '/path/to/drush/drush',
  ),
);

Then things are working properly. Fine for me.

Still, I wonder what the '%drush' path alias is for then.
Moreover, I found this in de the documentation of 'examples/example.aliases.drushrc.php':

'%drush': The path to the folder where drush is stored. Optional; defaults to the folder containing the running script. Always be sure to set '%drush' if the path to drush is different on the remote server.
'%drush-script': The path to the 'drush' script (used by backend invoke); default is 'drush' on remote machines, or the full path to drush.php on the local machine. Note that you only need to define one of '%drush' or '%drush-script', as drush can infer one from the other.

(emphasis is mine)

I guess something is wrong here: the documentation is outdated, %drush is deprecated or the code does not infer %drush-script correctly from %drush?

Comments

greg.1.anderson’s picture

Assigned: Unassigned » greg.1.anderson

I think that %drush should still be supported; if it is not, then it is a bug.

I will add this to my long list of simple things to fix; no objection if someone picks it up first, though.

greg.1.anderson’s picture

See related enhancement request #1163234: remote custom php path breaks drush

greg.1.anderson’s picture

Status: Active » Fixed

After reviewing how drush uses %drush and %drush-script, it became clear to me that %drush has been ignored, and %drush-script pretty solidly used for quite some time now. I felt that re-introducing %drush might cause some ambiguities between drush and drush.bat on the windows side; rather than deciding that windows users should not use %drush, I just fixed it in documentation, and declared %drush to be a read-only property (which matches the current implementation).

Committed to master and 4.x-dev. If anyone feels strongly that %drush should work, please re-open with a patch against master.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.