UNPKG

xrefcli

Version:

CLI command for the searching through OpenEdge XREF

38 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const help_1 = require("../help"); class SwitchCommand { constructor(config) { this.reponame = ''; this.config = config; } execute(params) { const promise = new Promise(resolve => { if (this.reponame !== undefined) { this.config.data.current = this.reponame; } console.log(this.config.data.current); resolve(); }); return promise; } validate(params) { const options = params['options']; if (options['help'] === true) { const help = new help_1.Help(); help.switchCommand(); process.exit(0); } const name = options['name']; if (name !== undefined) { if (!this.config.repoExists(name)) { console.error(`Error: repo ${name} doesn't not exist`); return false; } } this.reponame = name; return true; } } exports.SwitchCommand = SwitchCommand; //# sourceMappingURL=switch.js.map