steadybit
Version:
Command-line interface to interact with the Steadybit API
40 lines (37 loc) • 1.8 kB
JavaScript
;
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2022 Steadybit GmbH
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const safe_1 = __importDefault(require("colors/safe"));
const semver_1 = require("semver");
// eslint-disable-next-line @typescript-eslint/no-require-imports
const requiredNodejsVersion = require('../../package.json').engines.node;
const actualNodejsVersion = process.version;
if (!(0, semver_1.satisfies)(actualNodejsVersion, requiredNodejsVersion)) {
const help = `
Node.js version ${actualNodejsVersion} is not supported. The Steadybit CLI
requires a Node.js version that satisfies the following version range:
${safe_1.default.bold(requiredNodejsVersion)}
We recommend to install Node.js via a version manager. For example,
using the Node Version Manager (NVM):
${safe_1.default.bold('https://github.com/nvm-sh/nvm#readme')}
`;
console.error(safe_1.default.red(help.trim()));
process.exit(1);
}
new commander_1.Command()
// Prefer to load at runtime directly from the package.json to simplify
// the TypeScript build. Without this, we would have to make the build
// more complicated to adapt the root dir accordingly.
// eslint-disable-next-line
.version(require('../../package.json').version)
.command('advice', 'Show/verify advice status.')
.command('config', 'Show/modify the CLI configuration and authentication profiles.')
.command('experiment', 'Check and run experiments.')
.parseAsync(process.argv);
//# sourceMappingURL=steadybit.js.map