Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/util/exec"

Index

Classes

Interfaces

Functions

Functions

execIn

  • execIn(baseDir: string, cmd: string, args: string[]): Promise<ExecResult>
  • Safely exec a command in a specific directory.

    deprecated

    use execPromise

    Parameters

    • baseDir: string

      directory to run command in

    • cmd: string

      command to run

    • args: string[]

      command arguments

    Returns Promise<ExecResult>

    Promise of { stdout, stderr }

safeExec

  • safeExec(cmd: string, args?: string[], opts?: SpawnOptions): Promise<ExecResult>
  • Run a child process using cross-spawn, capturing and returning stdout and stderr, like exec, in a promise. If an error occurs, the process is killed by a signal, or the process exits with a non-zero status, the Promise is rejected. stdin is inherited from the parent process. Like with child_process.exec, this is not a good choice if the command produces a large amount of data on stdout or stderr.

    deprecated

    use execPromise

    Parameters

    • cmd: string

      name of command, can be a shell script or MS Windows .bat or .cmd

    • Default value args: string[] = []

      command arguments

    • Default value opts: SpawnOptions = {}

      standard spawn options

    Returns Promise<ExecResult>

    exec-like callback arguments having stdout and stderr properties

Generated using TypeDoc