Constructor Summary
Public Constructor | ||
public |
constructor(name: string, description: string) Creates a new UpdateCommand with the specified name and description. |
Method Summary
Public Methods | ||
public |
getLatestVersion(useBetaRelease: boolean): Promise<string> Checks atscm's dist-tags in the npm registry and resolves with the latest version available. |
|
public |
This command always needs to be run inside an existant atscm project. |
|
public |
Updates atscm if a newer version is available. |
|
public |
Runs |
|
public |
updateNeeded(latestVersion: string, currentVersion: string): boolean | string Checks if an update is required with the given latest and current version. |
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 UpdateCommand with the specified name and description.
Override:
Command#constructorPublic Methods
public getLatestVersion(useBetaRelease: boolean): Promise<string> source
Checks atscm's dist-tags in the npm registry and resolves with the latest version available.
Params:
Name | Type | Attribute | Description |
useBetaRelease | boolean |
|
If beta versions should be used. |
public requiresEnvironment(): boolean source
This command always needs to be run inside an existant atscm project.
Override:
Command#requiresEnvironmentpublic run(cli: AtSCMCli): Promise<*> source
Updates atscm if a newer version is available.
Override:
Command#runParams:
Name | Type | Attribute | Description |
cli | AtSCMCli | The cli instance used. |
Return:
Promise<*> | Resolved if the command completed suceessfully, rejected with the error that occurred otherwise. |
Test:
public update(cli: AtSCMCli, useBetaRelease: boolean): Promise<string, Error> source
Runs npm install --save-dev atscm@latest
in a separate process.
Return:
Promise<string, Error> | Fulfilled with npm's stdout or rejected with a spawn error or error code. |