(
containerName: string,
code: string,
opts: ExecOptions & { pythonArgs?: string[] } = {},
)
| 321 | } |
| 322 | |
| 323 | async execPython( |
| 324 | containerName: string, |
| 325 | code: string, |
| 326 | opts: ExecOptions & { pythonArgs?: string[] } = {}, |
| 327 | ): Promise<ExecResult> { |
| 328 | // Arguments after the python script will be read by the script as sys.argv and never as |
| 329 | // arguments to docker container exec itself, so the usage of `dangerouslyTrust` is fine. |
| 330 | const args = (opts.pythonArgs ?? []).map(dangerouslyTrust) |
| 331 | return await this.exec(containerName, ['python', trustedArg`-c`, code, ...args], opts) |
| 332 | } |
| 333 | |
| 334 | async execBash(containerName: string, code: string, opts: ExecOptions = {}): Promise<ExecResult> { |
| 335 | return await this.exec(containerName, ['bash', trustedArg`-c`, code], opts) |
no test coverage detected