Releaser
Bundles source files for release.
Example:
const config = {
vendor: "shinka",
code: "cli",
version: "0.0.1-a"
};
new Releaser({}, config);
// => shinka-news-0.0.1-a.zip
new Releaser({
vendor: "shin",
directory: "to/a/dir"
}, config);
// => to/a/dir/shin-news-0.0.1-a.zip
Constructor Summary
Public Constructor | ||
public |
constructor(cmd: Cmd, config: Config, logger: LogObject) |
Member Summary
Public Members | ||
public |
Command arguments. |
|
public |
For vendor, code, and version lookup. |
|
public |
|
|
public |
Output target. |
|
public |
logger#log is used to output progress, e.g. |
Method Summary
Public Methods | ||
public |
Builds error messages. |
|
public |
Executes |
|
public |
Builds filename from command arguments and config. |
|
public |
Outputs error messages. |
|
public |
Outputs success message. |
|
public |
release() Bundles source files for release with |
|
public |
Builds success message. |
Public Constructors
Public Members
public cmd: Cmd source
Command arguments.
Properties:
Name | Type | Attribute | Description |
cmd.output | string |
|
Overrides default filename format. |
cmd.directory | string |
|
Prepended to filename. |
cmd.vendor | string |
|
Vendor name, e.g. |
cmd.code | string |
|
Plugin code name, e.g. |
cmd.semver | string |
|
Semantic plugin version |
public logger: LogObject source
logger#log is used to output progress, e.g. Logger#log or console#log.
Public Methods
public getFileName(): string source
Builds filename from command arguments and config.
Format defaults to vendor-code-semver.zip
.
cmd.output
overwrites the default format.
cmd.directory
is prepended to the filename
Example:
new Releaser({}, config).getFileName();
// => shinka-cli-0.0.1-a.zip
new Releaser({
vendor: "shin",
code: "news",
version: "1.0.0"
}, config).getFileName();
// => shin-news-1.0.0.zip
new Releaser({
directory: "to/a/dir"
}, config).getFileName();
// => to/a/dir/shinka-news-0.0.1-a.zip
new Releaser({
directory: "to/a/dir",
output: "release.zip"
}, config).getFileName();
// => to/a/dir/release.zip