mirror of
https://github.com/zoriya/flood.git
synced 2026-05-27 17:11:58 +00:00
config.cli: simplify stderr/stdout forwarding with stdio inherit
This commit is contained in:
+3
-9
@@ -159,19 +159,13 @@ if (argv.rtorrent) {
|
||||
opts += `,import=${argv.rtconfig}`;
|
||||
}
|
||||
|
||||
const rTorrentProcess = spawn('rtorrent', args.concat(['-o', opts]));
|
||||
const rTorrentProcess = spawn('rtorrent', args.concat(['-o', opts]), {stdio: 'inherit'});
|
||||
|
||||
rTorrentProcess.stderr.on('data', (data) => {
|
||||
console.error(`${data}`);
|
||||
});
|
||||
rTorrentProcess.stdout.on('data', (data) => {
|
||||
console.log(`${data}`);
|
||||
});
|
||||
rTorrentProcess.on('close', () => {
|
||||
process.exit();
|
||||
process.exit(1);
|
||||
});
|
||||
rTorrentProcess.on('error', () => {
|
||||
process.exit();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('exit', () => {
|
||||
|
||||
Reference in New Issue
Block a user