UNPKG

1.07 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const help_1 = require("../help");
4class RemoveCommand {
5 constructor(config) {
6 this.reponame = '';
7 this.config = config;
8 }
9 execute(params) {
10 this.config.removeRepo(this.reponame);
11 this.config.data.current = '';
12 console.log(this.reponame);
13 }
14 validate(params) {
15 const options = params['options'];
16 if (options['help'] === true) {
17 const help = new help_1.Help();
18 help.removeCommand();
19 process.exit(0);
20 }
21 const reponame = options['name'];
22 if (reponame === undefined) {
23 console.error('Error: a repo name should be provided');
24 return false;
25 }
26 if (!this.config.repoExists(reponame)) {
27 console.error(`Error: repo '${reponame}' does not exist`);
28 return false;
29 }
30 this.reponame = reponame;
31 return true;
32 }
33}
34exports.RemoveCommand = RemoveCommand;
35//# sourceMappingURL=remove.js.map
\No newline at end of file