Skip to main content

Commands

Helper functions for checking if commands exist.

Functions

commandExists()

function commandExists(commandName): boolean

Defined in: functions/commands.ts:16

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


getPythonCommand()

Call Signature

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

Defined in: functions/commands.ts:29

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"

Call Signature

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

Defined in: functions/commands.ts:40

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

undefined | "python" | "python3"