Interface: Exec
Interface: Exec
Docker Desktop 확장 SDK의 Exec 인터페이스예요. 명령을 실행하고 그 결과를 promise로 받거나, 긴 출력을 스트림으로 받는 데 써요.
출처: 문서
본문
Interface: Exec
호출 가능
Exec
▸ Exec(cmd, args, options?): Promise<ExecResultExecResult)>
Executes a command.
Since
0.2.0
파라미터
Name | Type | Description
cmd | string | The command to execute.
args | string[] | The arguments of the command to execute.
options? | ExecOptionsExecOptions) | The list of options.
반환값
Promise<ExecResultExecResult)>
A promise that will resolve once the command finishes.
Exec
▸ Exec(cmd, args, options): ExecProcessExecProcess)
Streams the result of a command if stream is specified in the options parameter.
Specify the stream if the output of your command is too long or if you need to stream things indefinitely (for example container logs).
Since
0.2.2
파라미터
Name | Type | Description
cmd | string | The command to execute.
args | string[] | The arguments of the command to execute.
options | SpawnOptionsSpawnOptions) | The list of options.
반환값
ExecProcessExecProcess)
The spawned process.