@.task.execute.sync()
APITask
同步执行外部命令
调用方法
- (command) -> spawned
- (command, switches) -> spawned
- (command, switches, silent) -> spawned
- (command, switches, cwd) -> spawned
- (command, switches, env, silent) -> spawned
- (command, switches, cwd, env) -> spawned
- (command, switches, cwd, silent) -> spawned
- (command, switches, cwd, env, silent) -> spawned
- (command, switches, {cwd, env, silent}) -> spawned
- ({command, switches, cwd, env, silent}) -> spawned
参数介绍
- command: String需要执行的外部程序名
- switches: [String ...]需要执行的外部程序参数列表
- silent: Boolean外部执行程序时是否需要桥接IO
- env: Object<name, value>外部执行程序的环境参量
- cwd: String外部程序执行时的当前目录路径
返回内容
- spawned: ChildProcess新创建的子程序
关联API