Skip to main content

executeCommandRunUntilError

codebolt.terminal.executeCommandRunUntilError(command: string): 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

NameTypeDescription
commandstringThe command to be executed.

Returns:

 Promise<CommandError>
A promise that resolves when an error occurs during command execution.

Example


codebolt.terminal.executeCommandRunUntilError("npm i nodemon")

Explaination

The codebolt.terminal.executeCommandRunUntilError function takes a single parameter, command, which is a string representing the command you want to execute in the terminal. The function runs the specified command repeatedly until an error occurs.

command (string): The command to be executed in the terminal.