spleeter
Version:
Deezers spleeter CLI
29 lines (22 loc) • 612 B
JavaScript
const { spawn } = require('child_process')
const { getBinaryPath } = require('./getBinaryPath')
module.exports = { runBinary }
const binaryPath = getBinaryPath()
function runBinary (args = []) {
if (!binaryPath) {
return process.exit(1)
}
const proc = spawn(binaryPath, args, {
env: process.env,
stdio: ['ignore', process.stdout, process.stderr],
})
proc.on('exit', (code, signal) => {
if (signal) {
process.kill(process.pid, signal)
}
if (code) {
process.exitCode = code
}
process.exit()
})
}