Open misshy opened 6 years ago
i found that publish muti files to remote same folder that only send one file , so i try send twice (here is the code),but sometimes it will miss some files but not always. i donnot know why .please give some solution.
fileAndPublishPath.forEach(e => { promises.push(this.publishFileToRemote(e['filePath'], e['publishPath'], address.sshPort, address.ip)); });
publishFileToRemote(filePath, publishPath, port, ip) { return new Promise((resolve, reject) => { client.scp(filePath, { host: `${ip}`, username: `${publishJson.USER}`, password: `${publishJson.PASSWORD}`, port: port, path: publishPath }, (err) => { if (err) { client.scp(filePath, { host: `${ip}`, username: `${publishJson.USER}`, password: `${publishJson.PASSWORD}`, port: port, path: publishPath }, (err) => { if (err){ reject(err); } else{ resolve("successful"); } }) } else { resolve("successful"); } }) }) }
@misshy Maybe this library (https://github.com/steelbrain/node-ssh) is better for you.
i found that publish muti files to remote same folder that only send one file , so i try send twice (here is the code),but sometimes it will miss some files but not always. i donnot know why .please give some solution.