Skip to main content

functions/commandExists

Functions

commandExists()

function commandExists(commandName): boolean

Helper function to check if a command exists, like "git".

This is a wrapper around the commandExists.sync function from the commandExists library.

Parameters

ParameterType
commandNamestring

Returns

boolean

Defined in

functions/commandExists.ts:10


getPythonCommand()

getPythonCommand(fatal)

function getPythonCommand(fatal): "python" | "python3"

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.

Parameters
ParameterTypeDescription
fataltrueWhether to exit the program if Python is not found.
Returns

"python" | "python3"

Defined in

functions/commandExists.ts:23

getPythonCommand(fatal)

function getPythonCommand(fatal): "python" | "python3" | undefined

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.

Parameters
ParameterTypeDescription
fatalfalseWhether to exit the program if Python is not found.
Returns

"python" | "python3" | undefined

Defined in

functions/commandExists.ts:34