'use strict';constcp=require('child_process');constparse=require('./lib/parse');constenoent=require('./lib/enoent');functionspawn(command,args,options){// Parse the argumentsconstparsed=parse(command,args,options);// Spawn the child processconstspawned=cp.spawn(parsed.command,parsed.args,parsed.options);// Hook into child process "exit" event to emit an error if the command// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16enoent.hookChildProcess(spawned,parsed);returnspawned;}functionspawnSync(command,args,options){// Parse the argumentsconstparsed=parse(command,args,options);// Spawn the child processconstresult=cp.spawnSync(parsed.command,parsed.args,parsed.options);// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16result.error=result.error||enoent.verifyENOENTSync(result.status,parsed);returnresult;}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent;