Skip to content

Commands

Helper functions for checking if commands exist.

function commandExists(commandName): Promise<boolean>;

Defined in: functions/commands.ts:14

Helper function to check if a specific command exists on the system by attempting to resolve it with the “which” library.

Parameter Type
commandName string

Promise<boolean>


function getPythonCommand(fatal): Promise<"python" | "python3">;

Defined in: functions/commands.ts:33

Helper function to get the locally installed Python command. In most cases, this will be “python”, but on Ubuntu it will be “python3” (for legacy reasons). This is necessary to know if JavaScript/TypeScript is launching Python.

Returns undefined if Python is not installed on the system.

Parameter Type Description
fatal true Whether to exit the program if Python is not found.

Promise<"python" | "python3">

function getPythonCommand(fatal): Promise<"python" | "python3" | undefined>;

Defined in: functions/commands.ts:36

Helper function to get the locally installed Python command. In most cases, this will be “python”, but on Ubuntu it will be “python3” (for legacy reasons). This is necessary to know if JavaScript/TypeScript is launching Python.

Returns undefined if Python is not installed on the system.

Parameter Type Description
fatal false Whether to exit the program if Python is not found.

Promise<"python" | "python3" | undefined>