diff options
author | liam4 <towerofnix@gmail.com> | 2017-06-12 08:18:53 -0300 |
---|---|---|
committer | liam4 <towerofnix@gmail.com> | 2017-06-12 08:18:53 -0300 |
commit | 05cbc5d6d5b3290fd0b98061c27760467dce17ec (patch) | |
tree | e24d0303816d0eeb92582997813efd3e9c499af6 /src/promisify-process.js | |
parent | 632574cd9772d36a4ccb77483c00a85e5e06ba36 (diff) |
Spooks and baddies with ffprobe
Diffstat (limited to 'src/promisify-process.js')
-rw-r--r-- | src/promisify-process.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/promisify-process.js b/src/promisify-process.js index d330055..58a8597 100644 --- a/src/promisify-process.js +++ b/src/promisify-process.js @@ -2,14 +2,16 @@ const { Writable } = require('stream') -module.exports = function promisifyProcess(proc) { +module.exports = function promisifyProcess(proc, showLogging = true) { // Takes a process (from the child_process module) and returns a promise // that resolves when the process exits (or rejects, if the exit code is // non-zero). return new Promise((resolve, reject) => { - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) + if (showLogging) { + proc.stdout.pipe(process.stdout) + proc.stderr.pipe(process.stderr) + } proc.on('exit', code => { if (code === 0) { |