Thursday 23 April 2020

Recieving error when running child Process to run shaka packager

I am trying to learn how to chain commands together using child processes. Trying to utilize shaka packager to create dash mpds.Now at the cp.exec function if I runcp.execSync('cd scripts/src/out/Release/ && ls', exec_options); it shows the contents in that directory. But there is the packager.exe file I am trying to run, when I use the below codecp.execSync('cd scripts/src/out/Release/ && ./packager --help', exec_options); I get the error:'.' is not recognized as an internal or external command, operable program or batch file. { Error: Command failed: cd scripts/src/out/Release/ && ./packager --help '.' is not recognized as an internal or external command, operable program or batch file. ​How do I use the ./runafile syntax using a child process?​const cp = require('child_process'); const makeMpd = async function(videoUrls, req, res) { const exec_options = { cwd: null, env: null, encoding: 'utf8', timeout: 0, maxBuffer: 200 * 1024 }; try { let data = cp.execSync('cd scripts/src/out/Release/ && ./packager --help', exec_options); console.log('#2. exec sync'); console.log(data.toString()); } catch (err) { console.log(err); } }

Submitted April 23, 2020 at 09:38PM by bankfraud1

No comments:

Post a Comment