cli.ts

Declarations
#

6 declarations

view source

Cli
#

find_cli
#

cli.ts view source

(name: string, cwd?: string | URL, options?: SpawnOptions | undefined): Promise<Cli | null>

Searches the filesystem for the CLI name, first local to the cwd and then globally.

name

type string

cwd

type string | URL
default process.cwd()

options?

type SpawnOptions | undefined
optional

returns

Promise<Cli | null>

null if not found locally or globally

resolve_cli
#

cli.ts view source

(name_or_cli: string | Cli, args: string[] | undefined, cwd: string | URL | undefined, log?: Logger | undefined, options?: SpawnOptions | undefined): Promise<...>

name_or_cli

type string | Cli

args

type string[]
default []

cwd

type string | URL | undefined

log?

type Logger | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<Cli | undefined>

spawn_cli
#

cli.ts view source

(name_or_cli: string | Cli, args?: string[], log?: Logger | undefined, options?: SpawnOptions | undefined): Promise<SpawnResult | undefined>

Spawns a CLI if available using Belt's spawn. If a string is provided for name_or_cli, it checks first local to the cwd and then globally.

name_or_cli

type string | Cli

args

type string[]
default []

log?

type Logger | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<SpawnResult | undefined>

undefined if no CLI is found, or the spawn result

spawn_cli_process
#

cli.ts view source

(name_or_cli: string | Cli, args?: string[], log?: Logger | undefined, options?: SpawnOptions | undefined): Promise<SpawnedProcess | undefined>

Spawns a CLI if available using Belt's spawn_process. If a string is provided for name_or_cli, it checks first local to the cwd and then globally.

name_or_cli

type string | Cli

args

type string[]
default []

log?

type Logger | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<SpawnedProcess | undefined>

undefined if no CLI is found, or the spawn result

to_cli_name
#

Depends on
#

Imported by
#