CLI utilities, useful to run commands.

interface CliUtils {
    shelljs: __module;
    shelljsSafeExec: ((command, errorMessage?) => ShellString);
    spawn: ((command, params?) => Promise<null | number>);
    spawnSync: ((command, params?) => SpawnSyncReturns<Buffer>);
}

Properties

shelljs: __module

Shelljs instance, useful to run scripts. For more information refer to shelljs npm package.

shelljsSafeExec: ((command, errorMessage?) => ShellString)

Function that executes a command using shelljs. If the exit code is not 0 it throws an exception.

Type declaration

    • (command, errorMessage?): ShellString
    • Parameters

      • command: string
      • Optional errorMessage: string

      Returns ShellString

spawn: ((command, params?) => Promise<null | number>)

Function that executes a command using javascript spawn. The result is a resolved promise when the exit code is 0, otherwise it is a rejected promise.

Type declaration

    • (command, params?): Promise<null | number>
    • Parameters

      • command: string
      • Optional params: string[]

      Returns Promise<null | number>

spawnSync: ((command, params?) => SpawnSyncReturns<Buffer>)

Function that executes a command using javascript spawnSync. The result is a resolved promise when the exit code is 0, otherwise it is a rejected promise.

Type declaration

    • (command, params?): SpawnSyncReturns<Buffer>
    • Parameters

      • command: string
      • Optional params: string[]

      Returns SpawnSyncReturns<Buffer>