add sshCmdArgs option

This commit is contained in:
Dragan Filipovic 2023-01-02 01:33:48 +01:00
parent a16ae38e86
commit a285ca6ac0
5 changed files with 17 additions and 14 deletions

View file

@ -25,14 +25,13 @@ const validateRsync = () => new Promise(async (resolve, reject) => {
const rsyncCli = ({
source, sshServer, exclude, remotePort,
privateKey, args, callback
privateKey, args, sshCmdArgs, callback
}) => {
console.log(`[Rsync] Starting Rsync Action: ${source} to ${sshServer}`);
if (exclude) console.log(`[Rsync] excluding folders ${exclude}`);
const defaultOptions = {
ssh: true,
sshCmdArgs: ['-o StrictHostKeyChecking=no'],
recursive: true
};
@ -40,9 +39,9 @@ const rsyncCli = ({
// RSYNC COMMAND
/* eslint-disable object-property-newline */
nodeRsync({
...defaultOptions,
src: source, dest: sshServer, excludeFirst: exclude, port: remotePort,
privateKey, args,
...defaultOptions
privateKey, args, sshCmdArgs,
}, (error, stdout, stderr, cmd) => {
if (error) {
console.error('⚠️ [Rsync] error: ', error.message);