@commercelayer/cli
Version:
34 lines (33 loc) • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const cli_core_1 = require("@commercelayer/cli-core");
const core_1 = require("@oclif/core");
class CliVersion extends core_1.Command {
static description = 'Show installed version of Commerce Layer CLI';
static aliases = ['version'];
static examples = [
'<%= config.bin %> <%= command.id %>',
];
static flags = {
plugins: core_1.Flags.boolean({
char: 'p',
description: 'show version of installed plugins'
})
};
async run() {
const { flags } = await this.parse(CliVersion);
const cliVersion = this.config.version;
this.log();
this.log(cli_core_1.clColor.underline(`\u00A9 ${new Date().getFullYear()} Commerce Layer`));
this.log();
this.log(`${this.config.name} ${cli_core_1.clColor.cyanBright(cliVersion)}`);
this.log();
if (flags.plugins) {
this.log(cli_core_1.clColor.style.title('Installed plugins:'));
await this.config.runCommand('plugins');
this.log();
}
return cliVersion;
}
}
exports.default = CliVersion;