I'm writing a script where I'd like to run .make file, but it fails with the following error:

$ drush @remote.test make --no-core profiles/foo/contrib.make --yes
Calling proc_open(ssh drush@remote 'COLUMNS=278 drush  --verbose --yes --root=/var/www  make profiles/foo/contrib.make   --no-core 2>&1' 2>&1);
file_get_contents(profiles/foo/contrib.make): failed to open stream: No such file or directory make.utilities.inc:487

despite the file exists. I don't want to hardcode absolute path, as I'd like to use the same command for other remotes.

The command fails, because current directory of drush is set to HOME folder, instead of webroot (which is correctly passed internally via --root). This example could be related to issue where drush shell alias is downloading the project into wrong directory.

So the question is: How I can use drush make to execute .make file on remote host using relative path? As it seems to work fine on local.

I'm using drush 7.0-dev on local and remote.

2 Answers 2


For workaround, the following command should work:

$ drush @remote.test make --no-core $(drush @remote.test dd)/profiles/foo/contrib.make

Command drush dd will return the webroot path and pass it to outer command.


I had a slightly different problem of running drush from behat and needing to switch to a relative path (docroot) on different environments:

drush --root=$(pwd)/docroot [DRUSH COMMAND HERE]

where $(pwd) prints the working directory

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.