Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Support verbose flag for rsync command
Browse files Browse the repository at this point in the history
  • Loading branch information
lekkas committed Jun 22, 2016
1 parent 03c8cbc commit 870a966
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 13 additions & 1 deletion build/rsync.js
Expand Up @@ -76,6 +76,11 @@ exports.getCommand = function(options) {
description: 'ignore',
type: ['string', 'array'],
message: 'Not a string or array: ignore'
},
verbose: {
description: 'verbose',
type: 'boolean',
message: 'Not a boolean: verbose'
}
}
});
Expand All @@ -85,12 +90,19 @@ exports.getCommand = function(options) {
destination: "" + username + "@ssh." + (settings.get('proxyUrl')) + ":",
progress: options.progress,
shell: ssh.getConnectCommand(options),
flags: 'az'
flags: {
'a': true,
'z': true,
'v': options.verbose
}
};
if (options.ignore != null) {
args.exclude = options.ignore;
}
result = rsync.build(args).command();
result = result.replace(/\\\\/g, '\\');
if (options.verbose) {
console.log("resin sync command: " + result);
}
return result;
};
12 changes: 11 additions & 1 deletion lib/rsync.coffee
Expand Up @@ -61,6 +61,10 @@ exports.getCommand = (options = {}) ->
description: 'ignore'
type: [ 'string', 'array' ]
message: 'Not a string or array: ignore'
verbose:
description: 'verbose'
type: 'boolean'
message: 'Not a boolean: verbose'

{ username } = options
args =
Expand All @@ -74,7 +78,11 @@ exports.getCommand = (options = {}) ->
# files, and not just copies them blindly.
#
# z = compress during transfer
flags: 'az'
# v = increase verbosity
flags:
'a': true
'z': true
'v': options.verbose

# For some reason, adding `exclude: undefined` adds an `--exclude`
# with nothing in it right before the source, which makes rsync
Expand All @@ -88,4 +96,6 @@ exports.getCommand = (options = {}) ->
# backslashes on Windows for some reason.
result = result.replace(/\\\\/g, '\\')

console.log("resin sync command: #{result}") if options.verbose

return result

0 comments on commit 870a966

Please sign in to comment.