@holographxyz/cli
Version:
Holograph operator CLI
36 lines (35 loc) • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const view_1 = tslib_1.__importDefault(require("./view"));
class ConfigNetworks extends view_1.default {
static description = 'View the current network config.';
static examples = [
'$ <%= config.bin %> <%= command.id %>',
'$ <%= config.bin %> <%= command.id %> --output json',
'$ <%= config.bin %> <%= command.id %> --output yaml',
'$ <%= config.bin %> <%= command.id %> --output clean',
];
/**
* Command Entry Point
*/
async run() {
const { flags } = await this.parse(view_1.default);
await this.setup();
switch (flags.output) {
case 'json':
this.log(JSON.stringify(this.configJson.networks, null, 2));
break;
case 'yaml':
this.yaml.contents = this.configJson.networks;
this.log(this.yaml.toString());
break;
case 'clean':
default:
this.serializeClean(this.configJson.networks, '');
break;
}
this.exit();
}
}
exports.default = ConfigNetworks;