@.task.execute()
APITask
执行外部命令
调用方法
- (command, callback) -> spawned
- (command, switches, callback) -> spawned
- (command, switches, silent, callback) -> spawned
- (command, switches, cwd, callback) -> spawned
- (command, switches, env, silent, callback) -> spawned
- (command, switches, cwd, env, callback) -> spawned
- (command, switches, cwd, silent, callback) -> spawned
- (command, switches, cwd, env, silent, callback) -> spawned
- (command, switches, {cwd, env, silent, blackhole}, callback) -> spawned
- ({command, switches, cwd, env, silent, blackhole}, callback) -> spawned
参数介绍
- command: String需要执行的外部程序名
- switches: [String ...]需要执行的外部程序参数列表
- silent: Boolean外部执行程序时是否需要桥接IO
- env: Object<name, value>外部执行程序的环境参量
- cwd: String外部程序执行时的当前目录路径
- blackhole: Boolean是否放弃IO缓存
- callback: (error, stdout, stderr) -> void程序运行结束时的回调
- error: Error外部程序运行出错时的错误信息
- stdout: String外部程序输出
- stderr: String外部程序错误输出
返回内容
- spawned: ChildProcess新创建的子程序
关联API
- @.task.execute.sync()
- @.task.pty()
- @.task.resolve()