You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
I am running into a problem with the /drush.wrapper file. I'm not sure if there's a good way to fix this, but I wanted to bring it up.
So, drush.wrapper will call the vendor/bin/drush.launcher executable and pass in the "-r $DOCROOT" (which is the project/local docroot) for what I can tell is all invocations of the drush command.
The problem I am seeing is that calling $ drush @alias status from my repo root causes me to see the simple output of status, anytime you run it from a non-Drupal directory.
Here are the commands I'm running, from each place, and the output:
from /repo/root/ I run $ drush status
I get the status of my local site. I believe this is the intended behavior of the drush.wrapper file, to be able to run a drush command from anywhere in the repo.
from /repo/root/ I run $ drush @alias status
I get the basic drush output, like it can't find the Drupal install. I see 3 PHP variable outputs (php exec, config, os), and 5 drush variable outputs (drush script, version, config, temp directory, alias file). This is what I think is wrong.
from /repo/root/docroot I run $ drush status
Same as first output.
from /repo/root/docroot I run $ drush @alias status
Same as first output.
When I run the first two commands with the "-debug" flag, it seems that the remote drush operation is being called with the LOCAL root in the alias example, instead of the remote root that is specified in my alias file. I'm not sure why this would be? Running the same command IN the project docroot lets those values be set correctly, though.
Here is the obfuscated output of the alias commands, first in the repo root, then in the docroot.
Command: /var/www/mysite$ drush @alias status
Notice in this 2nd command that the --root flag is set correctly to the remote docroot.
I hope this makes sense? Please let me know if I can clarify anything here...? Is this a necessary evil, or is there anything I can try to work around this?
The text was updated successfully, but these errors were encountered:
dpagini
changed the title
Remote Drush commands
Remote Drush commands from blt repo root
Sep 19, 2016
dpagini
changed the title
Remote Drush commands from blt repo root
Remote Drush commands from BLT repo root
Sep 19, 2016
This fixesacquia#426.
By removing the directory detection and passthrough we remove the ability to run `drush` commands from the BLT project root and this will now need to be run from the `docroot` directory. However this allows Drush to correctly infer the `root` from defined aliases so if you set up a local drush alias you can still run `drush @local` from the BLT project root.
This fixed issues I was having with running remote drush commands and I don't think it's necessary to detect and pass in the root directory with the `-r` option.
This is working with global and local drush installs, ie.
```
./drush.wrapper @Local status
./drush.wrapper @dev status
```
and
```
drush @Local status
drush @dev status
```
This fixes#426.
By removing the directory detection and passthrough we remove the ability to run `drush` commands from the BLT project root and this will now need to be run from the `docroot` directory. However this allows Drush to correctly infer the `root` from defined aliases so if you set up a local drush alias you can still run `drush @local` from the BLT project root.
This fixed issues I was having with running remote drush commands and I don't think it's necessary to detect and pass in the root directory with the `-r` option.
This is working with global and local drush installs, ie.
```
./drush.wrapper @Local status
./drush.wrapper @dev status
```
and
```
drush @Local status
drush @dev status
```
I am running into a problem with the
/drush.wrapper
file. I'm not sure if there's a good way to fix this, but I wanted to bring it up.So,
drush.wrapper
will call thevendor/bin/drush.launcher
executable and pass in the "-r $DOCROOT" (which is the project/local docroot) for what I can tell is all invocations of the drush command.The problem I am seeing is that calling
$ drush @alias status
from my repo root causes me to see the simple output of status, anytime you run it from a non-Drupal directory.Here are the commands I'm running, from each place, and the output:
/repo/root/
I run$ drush status
/repo/root/
I run$ drush @alias status
/repo/root/docroot
I run$ drush status
/repo/root/docroot
I run$ drush @alias status
When I run the first two commands with the "-debug" flag, it seems that the remote drush operation is being called with the LOCAL root in the alias example, instead of the remote root that is specified in my alias file. I'm not sure why this would be? Running the same command IN the project docroot lets those values be set correctly, though.
Here is the obfuscated output of the alias commands, first in the repo root, then in the docroot.
Command:
/var/www/mysite$ drush @alias status
Command:
/var/www/mysite/docroot$ drush @alias status
Notice in this 2nd command that the
--root
flag is set correctly to the remote docroot.I hope this makes sense? Please let me know if I can clarify anything here...? Is this a necessary evil, or is there anything I can try to work around this?
The text was updated successfully, but these errors were encountered: