Constructor Summary
Public Constructor | ||
public |
constructor(name: string, description: string) Creates a new InitCommand with the specified name and description. |
Method Summary
Public Methods | ||
public |
Checks the version of this package against the "engines > atscm-cli" field of the newly installed atscm module's package file. |
|
public |
Checks if the given path contains an empty directory. |
|
public |
createEmptyPackage(path: string): Promise<undefined, Error> Creates a an empty package file at the given path. |
|
public |
getDefaultOptions(options: Object[]): * Returns the default values for the given init options. |
|
public |
Resolves the needed options from the local atscm module and asks for them. |
|
public |
Runs |
|
public |
Installs any additional dependencies needed after writing files. |
|
public |
Installs the local atscm module at the given path. |
|
public |
This command never requires an Liftoff.Environment. |
|
public |
Creates a new atscm project. |
|
public |
Runs npm with the given args. |
|
public |
Runs the local atscm module's init script. This script is stored in the |
Inherited Summary
From class Command | ||
public get |
The minimum and maximum number of (non-option) arguments the command handles. |
|
public get |
The options available for the command. |
|
public get |
If an error should be thrown for unknown arguments. |
|
public get |
Returns the usage string for the command. |
|
public |
The command descriptions. |
|
public |
The command's name. |
|
private |
The command's raw options. |
|
public |
requiresEnvironment(cli: AtSCMCli): boolean Returns |
|
public |
Runs the command with the current Cli instance. |
Public Constructors
public constructor(name: string, description: string) source
Creates a new InitCommand with the specified name and description.
Override:
Command#constructorPublic Methods
public checkCliVersion(env: Liftoff.Environment): Liftoff.Environment source
Checks the version of this package against the "engines > atscm-cli" field of the newly installed atscm module's package file.
Params:
Name | Type | Attribute | Description |
env | Liftoff.Environment | The environment to check. |
Throw:
Throws an error if the atscm-cli version does not match. |
public checkDirectory(path: string, overwrite: boolean): Promise<string, Error> source
Checks if the given path contains an empty directory. OS specific temporary files (.DS_Store under macOS, thumbs under Windows) are ignored.
public createEmptyPackage(path: string): Promise<undefined, Error> source
Creates a an empty package file at the given path.
Params:
Name | Type | Attribute | Description |
path | string | The location to create the package at. |
public getDefaultOptions(options: Object[]): * source
Returns the default values for the given init options.
Params:
Name | Type | Attribute | Description |
options | Object[] | An array of init options to check. |
Return:
* |
public getOptions(modulePath: string, options: Object): Promise<Object, Error> source
Resolves the needed options from the local atscm module and asks for them. These options are
stored in the atscm
module inside out/init/options
.
Test:
public install(path: string, packages: string | string[]): Promise<undefined, Error> source
Runs npm install --save-dev {packages}
at the given path.
Test:
public installDependencies(path: string, deps: string[]): Promise<undefined, Error> source
Installs any additional dependencies needed after writing files.
public async installLocal(path: string, options: Object): Promise<undefined, Error> source
Installs the local atscm module at the given path.
public requiresEnvironment(): boolean source
This command never requires an Liftoff.Environment.
Override:
Command#requiresEnvironmentpublic run(cli: AtSCMCli): * source
Creates a new atscm project.
Override:
Command#runParams:
Name | Type | Attribute | Description |
cli | AtSCMCli | The current Cli instance. |
Return:
* |
Test:
public writeFiles(modulePath: string, options: Object): Promise<{install: string[]}, Error>{install:> source
Runs the local atscm module's init script. This script is stored in the atscm
module inside
out/init/init
.
Params:
Name | Type | Attribute | Description |
modulePath | string | The path to the local module to use. |
|
options | Object | The options to apply (Received by calling InitCommand#getOptions). |
Return:
Promise<{install: string[]}, Error>{install:> | Resolved with information on the further init steps (which dependencies are needed), rejected with an error if running the init script failed. |