* Evaluates a given module in the File
(command: string, args: Array<string>, options: ShellCommandOptions = {})
| 89 | * Evaluates a given module in the File |
| 90 | */ |
| 91 | public async runCommand(command: string, args: Array<string>, options: ShellCommandOptions = {}): Promise<ShellInfo> { |
| 92 | invariant(!this.id, 'Failed to run "runCommand" on a ShellProcess: there is already a process running.'); |
| 93 | |
| 94 | const shellInfo = await this.channel.send('shell/runCommand', { command, args, options }); |
| 95 | |
| 96 | invariant(shellInfo, 'Failed to run "runCommand" on a ShellProcess: was not able to retrieve a running process.'); |
| 97 | |
| 98 | this.id = shellInfo.id; |
| 99 | this.state = 'running'; |
| 100 | |
| 101 | return shellInfo; |
| 102 | } |
| 103 | |
| 104 | public async on(message: 'exit', listener: (exitCode: number, error?: { message: string }) => void): Promise<void>; |
| 105 | public async on(message: 'progress', listener: (status: WorkerStatusUpdate) => void): Promise<void>; |