Module: cfgi/cli

Manages the generation of a new configuration file.
Author:
  • Gerard Hernandez
Source:

Requires

Methods

(static) generateIndividualTaskFile(options, imports, tasks) → {string}

Generates an individual task file.
Parameters:
Name Type Description
options TaskConfig The task configuration options.
imports Array.<string> The imports in the configuration file.
tasks Array.<{name: string, node: Node}> The tasks in the configuration file.
Source:
Returns:
- The generated task file.
Type
string

(static) generateMultiTaskFile(options, imports, tasks) → {string}

Generates a multi-task file.
Parameters:
Name Type Description
options TaskConfig The task configuration options.
imports Array.<string> The imports in the configuration file.
tasks Array.<{name: string, node: Node}> The tasks in the configuration file.
Source:
Returns:
- The generated multi-task file.
Type
string

(async, static) generateNewConfig(configNameopt) → {Promise.<string>}

Generates a new configuration file asynchronously.
Parameters:
Name Type Attributes Description
configName string <optional>
The name for the new configuration. If not provided, the user will be prompted for input.
Source:
Returns:
The name of the generated configuration file.
Type
Promise.<string>

(async, static) parseConfig(configFName) → {Promise.<options:TaskConfig, imports:Array.<string>, tasks:Array.<{name:string, node:Node}>>}

Parses the configuration file.
Parameters:
Name Type Description
configFName string The name of the configuration file.
Source:
Returns:
- The parsed configuration file.
Type
Promise.<options:TaskConfig, imports:Array.<string>, tasks:Array.<{name:string, node:Node}>>

(static) runInVM(code) → {void}

Runs the provided code in a virtual machine.
Parameters:
Name Type Description
code string The code to run.
Source:
Returns:
Type
void

(async, static) selectConfigNameFromDir(files) → {Promise.<string>}

Selects a configuration file from a directory.
Parameters:
Name Type Description
files Array.<string> The configuration files in the directory.
Source:
Returns:
- The name of the selected configuration file.
Type
Promise.<string>

(async, static) selectTaskFromConfig(tasks) → {Promise.<Array.<{name: string, node: Node}>>}

Selects a task from the configuration file.
Parameters:
Name Type Description
tasks Array.<{name: string, node: Node}> The tasks in the configuration file.
Source:
Returns:
- The selected tasks.
Type
Promise.<Array.<{name: string, node: Node}>>

(async, static) validateProvidedConfigName(name) → {Promise.<(string|undefined)>}

Validates the provided configuration name.
Parameters:
Name Type Description
name string The name of the configuration file.
Source:
Returns:
- The matched configuration file name.
Type
Promise.<(string|undefined)>
Manages the running of a configuration file.
Author:
  • Gerard Hernandez
Source:

Requires

Methods

(static) generateIndividualTaskFile(options, imports, tasks) → {string}

Generates an individual task file.
Parameters:
Name Type Description
options TaskConfig The task configuration options.
imports Array.<string> The imports in the configuration file.
tasks Array.<{name: string, node: Node}> The tasks in the configuration file.
Source:
Returns:
- The generated task file.
Type
string

(static) generateMultiTaskFile(options, imports, tasks) → {string}

Generates a multi-task file.
Parameters:
Name Type Description
options TaskConfig The task configuration options.
imports Array.<string> The imports in the configuration file.
tasks Array.<{name: string, node: Node}> The tasks in the configuration file.
Source:
Returns:
- The generated multi-task file.
Type
string

(async, static) generateNewConfig(configNameopt) → {Promise.<string>}

Generates a new configuration file asynchronously.
Parameters:
Name Type Attributes Description
configName string <optional>
The name for the new configuration. If not provided, the user will be prompted for input.
Source:
Returns:
The name of the generated configuration file.
Type
Promise.<string>

(async, static) parseConfig(configFName) → {Promise.<options:TaskConfig, imports:Array.<string>, tasks:Array.<{name:string, node:Node}>>}

Parses the configuration file.
Parameters:
Name Type Description
configFName string The name of the configuration file.
Source:
Returns:
- The parsed configuration file.
Type
Promise.<options:TaskConfig, imports:Array.<string>, tasks:Array.<{name:string, node:Node}>>

(static) runInVM(code) → {void}

Runs the provided code in a virtual machine.
Parameters:
Name Type Description
code string The code to run.
Source:
Returns:
Type
void

(async, static) selectConfigNameFromDir(files) → {Promise.<string>}

Selects a configuration file from a directory.
Parameters:
Name Type Description
files Array.<string> The configuration files in the directory.
Source:
Returns:
- The name of the selected configuration file.
Type
Promise.<string>

(async, static) selectTaskFromConfig(tasks) → {Promise.<Array.<{name: string, node: Node}>>}

Selects a task from the configuration file.
Parameters:
Name Type Description
tasks Array.<{name: string, node: Node}> The tasks in the configuration file.
Source:
Returns:
- The selected tasks.
Type
Promise.<Array.<{name: string, node: Node}>>

(async, static) validateProvidedConfigName(name) → {Promise.<(string|undefined)>}

Validates the provided configuration name.
Parameters:
Name Type Description
name string The name of the configuration file.
Source:
Returns:
- The matched configuration file name.
Type
Promise.<(string|undefined)>