Script
A class that represents the commands, control flow, and context of a singe script.
Static Method Summary
| Static Public Methods | ||
| public static |
Executes a single command with the given args, cwd, and env |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(st: Scripteasy, opts: object) Creates a new Script instance. |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
Static Public Methods
public static exec(command: string, args: Array<string>, cwd: string, env: object): Error source
Executes a single command with the given args, cwd, and env
Params:
| Name | Type | Attribute | Description |
| command | string | The command to execute. |
|
| args | Array<string> |
|
The args to pass into the command. |
| cwd | string |
|
The current working directory. |
| env | object |
|
The environment variables to execute the command with. |
Public Constructors
public constructor(st: Scripteasy, opts: object) source
Creates a new Script instance.
Params:
| Name | Type | Attribute | Description |
| st | Scripteasy | The parent Scripteasy instance. |
|
| opts | object |
|
The script configuration options. |
| opts.try | Array<string> | string |
|
The main script commands. |
| opts.catch | Array<string> | string |
|
The catch block commands that will run if the try block fails. |
| opts.finally | Array<string> | string |
|
The finally block commands that will always run after the try/ctch blocks. |
| opts.cwd | string |
|
The current working dir the script should run in. |
| opts.env | object |
|
The environment variables to pass in. These will not override environment variables in the current context. |
