1 | "use strict";
|
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3 | return new (P || (P = Promise))(function (resolve, reject) {
|
4 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
7 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8 | });
|
9 | };
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | const commons_config_1 = require("commons-config");
|
12 | const Bootstrap_1 = require("../Bootstrap");
|
13 | const util_1 = require("util");
|
14 | const System_1 = require("../libs/system/System");
|
15 | class ModulesCommand {
|
16 | constructor() {
|
17 | this.command = 'modules';
|
18 | this.aliases = 'm';
|
19 | this.describe = 'List modules';
|
20 | }
|
21 | builder(yargs) {
|
22 | return yargs;
|
23 | }
|
24 | beforeStartup() {
|
25 | System_1.System.enableDistribution(false);
|
26 | }
|
27 | handler(argv) {
|
28 | return __awaiter(this, void 0, void 0, function* () {
|
29 | const modules = Bootstrap_1.Bootstrap._().getModules();
|
30 | if (commons_config_1.Config.get('argv.json', false)) {
|
31 | console.log(util_1.inspect(modules, false, 10));
|
32 | }
|
33 | else {
|
34 | for (const modul of modules) {
|
35 | console.log('- Modul: ' + modul.name + ' ' + modul.version + ' (internal: ' + modul.internal + ')');
|
36 | }
|
37 | }
|
38 | });
|
39 | }
|
40 | }
|
41 | exports.ModulesCommand = ModulesCommand;
|
42 |
|
43 |
|