UNPKG

xrefcli

Version:

CLI command for the searching through OpenEdge XREF

39 lines 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const help_1 = require("../help"); class RemoveCommand { constructor(config) { this.reponame = ''; this.config = config; } execute(params) { const promise = new Promise(resolve => { this.config.removeRepo(this.reponame); this.config.data.current = ''; console.log(this.reponame); resolve(); }); return promise; } validate(params) { const options = params['options']; if (options['help'] === true) { const help = new help_1.Help(); help.removeCommand(); process.exit(0); } const reponame = options['name']; if (reponame === undefined) { console.error('Error: a repo name should be provided'); return false; } if (!this.config.repoExists(reponame)) { console.error(`Error: repo '${reponame}' does not exist`); return false; } this.reponame = reponame; return true; } } exports.RemoveCommand = RemoveCommand; //# sourceMappingURL=remove.js.map