mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2025-06-21 12:02:09 +10:00
fix: Add visible Rsync CMD for debugging
This commit is contained in:
parent
4f233a7f45
commit
91b6d280ae
3 changed files with 24 additions and 14 deletions
|
@ -2,6 +2,12 @@ const { execSync } = require('child_process');
|
|||
const nodeRsync = require('rsyncwrapper');
|
||||
|
||||
const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
|
||||
const logCMD = (cmd) => {
|
||||
console.warn('================================================================');
|
||||
console.log(cmd);
|
||||
console.warn('================================================================');
|
||||
};
|
||||
|
||||
try {
|
||||
nodeRsync(config, (error, stdout, stderr, cmd) => {
|
||||
if (error) {
|
||||
|
@ -11,10 +17,12 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
|
|||
console.error(stderr);
|
||||
console.error('❌️ [Rsync] stdout: ');
|
||||
console.error(stdout);
|
||||
console.error('❌ [Rsync] cmd: ', cmd);
|
||||
console.error('❌ [Rsync] command: ');
|
||||
logCMD(cmd);
|
||||
reject(new Error(`${error.message}\n\n${stderr}`));
|
||||
} else {
|
||||
console.log('⭐ [Rsync] cmd finished: ', cmd);
|
||||
console.log('⭐ [Rsync] command finished: ');
|
||||
logCMD(cmd);
|
||||
resolve(stdout);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue