executeCommandRunUntilError
plugin.terminal.executeCommandRunUntilError(command: string, executeInMain: boolean): Promise<CommandError>
Executes a given command and keeps running until an error occurs. Listens for messages from the WebSocket and resolves the promise when an error is encountered.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | Yes | The command to be executed. |
executeInMain | boolean | Yes | (default: false) |
Returns
Promise<CommandError> — A promise that resolves when an error occurs during command execution.
Example
import plugin from '@codebolt/plugin-sdk';
const result = await plugin.terminal.executeCommandRunUntilError('command', true);
console.log(result);