-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
The code checks for stderr.length to identify if the process existed successfully, but incase when logging is enable with -v or --log-level, it's written to stderr, which makes the promise API reject.
Here is a sample code that doesn't work:
await rclone.promises('command', {
'progress': true, 'log-level': process.env.DEBUG ? 'DEBUG' : 'INFO'
},
);
One that works:
const childProcess = rclone('command', {
'progress': true, 'log-level': process.env.DEBUG ? 'DEBUG' : 'INFO',
stdio: 'inherit',
},
);
await new Promise((resolve, reject) => {
childProcess.on('exit', (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(`Failed with code ${code}`));
}
});
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels