better reject message

This commit is contained in:
Dragan Filipovic 2023-01-02 18:31:40 +01:00
parent 9d9498978c
commit bc37bf088b
3 changed files with 15 additions and 11 deletions

View File

@ -64,9 +64,9 @@ jobs:
SOURCE: "test_project/" SOURCE: "test_project/"
TARGET: "/var/www/html/" TARGET: "/var/www/html/"
EXCLUDE: "/dist/, /node_modules/" EXCLUDE: "/dist/, /node_modules/"
SCRIPT_BEFORE: | # SCRIPT_BEFORE: |
whoami # whoami
ls -al # ls -al
SCRIPT_AFTER: | # SCRIPT_AFTER: |
whoami # whoami
ls -al # ls -al

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -5,10 +5,14 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
try { try {
nodeRsync(config, (error, stdout, stderr, cmd) => { nodeRsync(config, (error, stdout, stderr, cmd) => {
if (error) { if (error) {
console.log('⚠️ [Rsync] stderr: ', stderr); console.error('⚠️ [Rsync] error: ');
console.log('⚠️ [Rsync] stdout: ', stdout); console.error(error);
console.log('⚠️ [Rsync] cmd: ', cmd); console.error('⚠️ [Rsync] stderr: ');
reject(error); console.error(stderr);
console.error('⚠️ [Rsync] stdout: ');
console.error(stdout);
console.error('⚠️ [Rsync] cmd: ', cmd);
reject(new Error(`${error.message}\n\n${stderr}`));
} else { } else {
resolve(stdout); resolve(stdout);
} }