Commit aeba2823 authored by drumm's avatar drumm Committed by Neil Drumm

Make rsync options more flexible

parent b6bde86f
......@@ -99,7 +99,7 @@ function drush_provision_drupal_provision_install_backend() {
* finishing operations that affect the filesystem.
*/
function provision_drupal_sync_site() {
d()->service('http')->sync(d()->root, TRUE);
d()->service('http')->sync(d()->root, array('exclude-sites' => TRUE));
if (d()->type === 'site') {
d()->service('http')->sync(d()->site_path);
}
......
......@@ -424,24 +424,23 @@ class provisionServer extends provisionEnvironment {
*
* @param $path
* Full path to sync.
* @param $exclude_sites
* Exclude sites/*, except sites/all.
* @param $additional_options
* An array of options that overrides whatever was passed in on the command
* line (like the 'process' context, but only for the scope of this one
* call).
*/
function sync($path = NULL, $exclude_sites = FALSE) {
function sync($path = NULL, $additional_options = array()) {
if (!provision_is_local_host($this->remote_host)) {
if (is_null($path)) {
$path = $this->config_path;
}
if (provision_file()->exists($path)->status()) {
$options = array(
$options = array_merge(array(
'relative' => TRUE,
'omit-dir-times' => TRUE,
'delete' => TRUE,
);
if ($exclude_sites) {
$options['exclude-sites'] = TRUE;
}
), $additional_options);
if (drush_core_call_rsync(escapeshellarg($path), escapeshellarg($this->script_user . '@' . $this->remote_host . ':/'), $options, TRUE, FALSE)) {
drush_log(dt('@path has been synced to remote server @remote_host.', array('@path' => $path, '@remote_host' => $this->remote_host)));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment