-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@validate-file-exists doesn't seem to take --root into account #3131
Comments
The cwd should already be Drupal root by the time @validate-file-exists starts doing its work. See Line 183 in 514419f
|
Relative file paths used in options (e.g. The original cwd is available via the key Relative paths for remote commands are perhaps a dubious proposition. Logically, these are relative to the $HOME directory of the remote user. |
Drush 8 and earlier sets the cwd for remote commands to the Drupal root, so I suppose we should maintain that behavior. |
Its a problem in SqlCommands. Fixing now ... |
Maybe it would be helpful to cwd in preflight? |
Fixed in #3135. We decided not to move the chdir() to Preflight. |
Thank you, it works! :) |
I tried
drush @docker sql-query --file=../private/$DUMP
and got[error] File(s) not found: ../private/2017-11-02_17:12.sql
The same command work if I execute it directly inside the container, without any alias.
After some search, I found out that if I remove "@validate-file-exists file" from SQLCommands.php function query(), it works. I tried a getcwd() in validateFileExists(), before the call to file_exists() and got the wrong dir. I think it's because validateFileExists() doesn't take --root into account, which is added when the command is executed through SSH.
The text was updated successfully, but these errors were encountered: