From 110cc530573ddc9c672edf92ec176d37c7c599df Mon Sep 17 00:00:00 2001 From: Tushar Srivastava Date: Tue, 14 Nov 2017 19:53:50 +0530 Subject: [PATCH] Added two new functions for advanced users The functions "setCommand" and "resetCommand" are added to add a complete command string if you are not comfortable with command builder utility or if it is not sufficient for the command set you need. --- rsync.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rsync.js b/rsync.js index a8a7d73..edc8c14 100644 --- a/rsync.js +++ b/rsync.js @@ -330,7 +330,21 @@ Rsync.prototype.include = function(patterns) { * @return {String} */ Rsync.prototype.command = function() { - return this.executable() + ' ' + this.args().join(' '); + return this.currCommand || this.executable() + ' ' + this.args().join(' '); +}; + +/** + * Set the command that is going to be executed in case of advanced user + */ +Rsync.prototype.setCommand = function(str) { + this.currCommand = str; +}; + +/** + * Reset the command that is going to be executed in case of advanced user + */ +Rsync.prototype.resetCommand = function() { + this.currCommand = null; }; /**