UNPKG

@haechi-labs/henesis-cli

Version:

🚀 Command Line Interface tool to Utilize henesis

36 lines • 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const base_1 = tslib_1.__importDefault(require("../common/base")); const command_1 = require("@oclif/command"); const configstore_1 = tslib_1.__importDefault(require("../common/configstore")); class Config extends base_1.default { async run() { const { flags } = this.parse(Config); const re = new RegExp('^(https|http)://', 'i'); if (re.test(flags.endpoint)) { configstore_1.default.set('endpoint', flags.endpoint); this.log(`Successfully set to ${flags.endpoint}`); } else { this.error('You must enter url that matches the https form.\neg) $ henesis config -e https://api.henesis.io', { code: '101' }); } } } exports.default = Config; Config.hidden = true; Config.description = "It's an internally hidden interface. You can set up endpoints."; Config.examples = [ `$ henesis config -e https://... `, ]; Config.flags = { help: command_1.flags.help({ char: 'h' }), endpoint: command_1.flags.string({ char: 'e', description: 'Set the henesis endpoint.', required: true, }), }; Config.args = []; //# sourceMappingURL=config.js.map