Commands
Helper functions for checking if commands exist.
Functions
Section titled “Functions”commandExists()
Section titled “commandExists()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
commandName |
string |
Returns
Section titled “Returns”Promise<boolean>
getPythonCommand()
Section titled “getPythonCommand()”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
fatal |
true |
Whether to exit the program if Python is not found. |
Returns
Section titled “Returns”Promise<"python" | "python3">
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
fatal |
false |
Whether to exit the program if Python is not found. |
Returns
Section titled “Returns”Promise<"python" | "python3" | undefined>
