UNPKG

@veecode-platform/safira-cli

Version:

Generate a microservice project from your spec.

33 lines (32 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const color_1 = tslib_1.__importDefault(require("@oclif/color")); const core_1 = require("@oclif/core"); const safira_version_1 = require("../safira-globals/safira-version"); const safiraColors = tslib_1.__importStar(require("../colors.json")); class Upgrade extends core_1.Command { async run() { const { args, flags } = await this.parse(Upgrade); const latest = await safira_version_1.SafiraVersion.latestVersion(); const version = safira_version_1.SafiraVersion.version; const neonGreen = color_1.default.hex(safiraColors["neon-green"]); if (await safira_version_1.SafiraVersion.hasUpdate()) { console.log(""); console.log(color_1.default.white(`Safira version ${color_1.default.yellowBright(version)} is outdated. Latest version is ${neonGreen(latest)}`)); console.log(""); console.log("You can update safira-cli with the following script:"); console.log(color_1.default.bold("curl https://veecode-platform.github.io/support/install.sh -sSfL | bash")); } else { console.log(neonGreen.bold("The latest safira-cli version is already installed!")); } } } exports.default = Upgrade; Upgrade.description = "Safira-CLI upgrade"; Upgrade.examples = [ "<%= config.bin %> <%= command.id %>", ]; Upgrade.flags = {}; Upgrade.args = [];