Skip to content

Class ExecutableResolver

Source: executableResolver.ts

Constructors

Constructor

new ExecutableResolver(): ExecutableResolver

Returns

ExecutableResolver

Properties

builtins

static builtins: Command[] = []


NOT_FOUND_ERROR

readonly static NOT_FOUND_ERROR: "Command not found" = "Command not found"


IS_DIRECTORY_ERROR

readonly static IS_DIRECTORY_ERROR: "Is a directory" = "Is a directory"

Methods

resolve()

static resolve(name: string, env: ShellEnvironment, workingDirectory: VirtualFolder): Promise<ExecutableResolutionResult>

Finds the executable with the given name.

Parameters

name

string

The name of the executable.

env

ShellEnvironment

The environment to read the path variable from.

workingDirectory

VirtualFolder

The directory to search in.

Returns

Promise<ExecutableResolutionResult>


getBuiltin()

static getBuiltin(name: string): Command | null

Finds the builtin command with the given name.

Parameters

name

string

The name of the builtin.

Returns

Command | null

The builtin with the given name, or null if there is none.


loadBuiltins()

static loadBuiltins(): Promise<void>

Loads all builtins.

Returns

Promise<void>

A promise that resolves when all builtins have finished loading.

Built by Prozilla