Skip to main content

Class: Executables

The host programs electron-builder starts, from the toolsets.executables configuration of the current build. A build runs inside Executables.run, which scopes the configuration to everything the build does, including its asynchronous work, so that builds in one process do not see each other's configuration. Outside any build the default install locations are used. A program is never looked up on PATH.

Constructors​

Constructor​

new Executables(): Executables

Returns​

Executables

Accessors​

configuration​

Get Signature​

get static configuration(): Nullish | ExecutablesConfig

The toolsets.executables configuration of the current Executables.run scope (none outside of one).

Returns​

Nullish | ExecutablesConfig

Methods​

find()​

static find(name): string | null

The absolute path of a program, or null when it is not installed (for a program that is optional, like PowerShell 7).

Parameters​

name​

ExecutableName

Returns​

string | null


isConfigured()​

static isConfigured(name): boolean

Whether the configuration has a location of the program for this operating system. An entry with locations for other operating systems only, from a configuration shared by several hosts, does not count.

Parameters​

name​

ExecutableName

Returns​

boolean


notarytool()​

static notarytool(): Promise<string>

notarytool: its toolsets.executables entry when it is set, otherwise the notarytool of the selected Xcode, which /usr/bin/xcrun --find notarytool locates, so that notarytool never runs through an xcrun looked up on PATH.

Returns​

Promise<string>


resolve()​

static resolve(name): string

The absolute path of a program, or an InvalidConfigurationError that lists the locations tried.

Parameters​

name​

ExecutableName

Returns​

string


run()​

static run<T>(executables, fn): T

Runs fn with executables (the toolsets.executables configuration) as the configuration of every program it resolves. The configuration is checked first: an unknown name, a name with .exe, or a location that is not a file:// URI of a local file is an InvalidConfigurationError.

Type Parameters​

T​

T

Parameters​

executables​

Nullish | ExecutablesConfig

fn​

() => T

Returns​

T


stapler()​

static stapler(): Promise<string>

stapler (stapler validate checks a stapled notarization ticket): its toolsets.executables entry when it is set, otherwise the stapler of the selected Xcode, which /usr/bin/xcrun --find stapler locates.

Returns​

Promise<string>