Skip to content
Permalink
Browse files

Fix rsync upload honor become option for host (#1796)

  • Loading branch information...
jlmaners authored and antonmedv committed Jan 18, 2019
1 parent a7d03f8 commit 6e284828d703a4fcd0376a491be8fc71767e0255
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/functions.php
@@ -433,13 +433,19 @@ function upload($source, $destination, array $config = [])
if ($host instanceof Localhost) {
$rsync->call($host->getHostname(), $source, $destination, $config);
} else {
if (!isset($config['options']) || !is_array($config['options'])) {
$config['options'] = [];
}
$sshArguments = $host->getSshArguments()->getCliArguments();
if (empty($sshArguments) === false) {
if (!isset($config['options']) || !is_array($config['options'])) {
$config['options'] = [];
}
$config['options'][] = "-e 'ssh $sshArguments'";
}
if ($host->has("become")) {
$config['options'][] = "--rsync-path='sudo -H -u " . $host->get('become') . " rsync'";
}
$rsync->call($host->getHostname(), $source, "$host:$destination", $config);
}
}

0 comments on commit 6e28482

Please sign in to comment.
You can’t perform that action at this time.