Skip to content

Instantly share code, notes, and snippets.

@gaelg
Created June 22, 2017 15:52
Show Gist options
  • Save gaelg/bfed6ddafb4dcc7a45ef2d264ab782e6 to your computer and use it in GitHub Desktop.
Save gaelg/bfed6ddafb4dcc7a45ef2d264ab782e6 to your computer and use it in GitHub Desktop.
Fix for drush 8.1.10 : drush rsync with two remote aliases fails because the aliases are not replaced
diff --git a/commands/core/rsync.core.inc b/commands/core/rsync.core.inc
index 4bc9dbb..66fef6b 100644
--- a/commands/core/rsync.core.inc
+++ b/commands/core/rsync.core.inc
@@ -228,6 +228,12 @@ function _drush_rsync_option_exists($option, $additional_options) {
function _drush_core_rsync_both_remote($source, $destination, $additional_options, $source_path) {
$options = $additional_options + drush_redispatch_get_options();
+ // We do not want to include root or uri here. If the user
+ // provided -r or -l, their key has already been remapped to
+ // 'root' or 'uri' by the time we get here.
+ unset($options['root']);
+ unset($options['uri']);
+
// Make a temporary directory to copy to. There are three
// cases to consider:
//
@gaelg
Copy link
Author

gaelg commented Jun 22, 2017

I just copied the code used in sqlsync.drush.inc (which also needs rsync)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment