Skip to main content

Commands

Helper functions for checking if commands exist.

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

packages/complete-node/src/functions/commands.ts:16


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

packages/complete-node/src/functions/commands.ts:29

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

packages/complete-node/src/functions/commands.ts:40