trm-client 10.0.2 → 10.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -404,19 +404,21 @@ class AbstractCommand {
|
|
|
404
404
|
return __awaiter(this, arguments, void 0, function* (args = {}, options = {}) {
|
|
405
405
|
this.args = this.normalizeArgs(args);
|
|
406
406
|
this.onArgs();
|
|
407
|
-
|
|
407
|
+
this.registry = options.registry;
|
|
408
|
+
try {
|
|
409
|
+
yield this.handler();
|
|
410
|
+
}
|
|
411
|
+
catch (e) {
|
|
412
|
+
yield (0, utils_1.logError)(e);
|
|
413
|
+
throw new Error("Action failed.");
|
|
414
|
+
}
|
|
408
415
|
});
|
|
409
416
|
}
|
|
410
417
|
execute(...args) {
|
|
411
418
|
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
+
var exitCode = 0;
|
|
412
420
|
this.args = this.parseCommandArgs(args);
|
|
413
421
|
this.onArgs();
|
|
414
|
-
const exitCode = yield this.executePrepared(true);
|
|
415
|
-
process.exit(exitCode);
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
executePrepared(logErrors_1) {
|
|
419
|
-
return __awaiter(this, arguments, void 0, function* (logErrors, options = {}) {
|
|
420
422
|
try {
|
|
421
423
|
yield utils_1.GlobalContext.getInstance().load();
|
|
422
424
|
yield Commons.Plugin.call("client", "loadCore", { core: Core });
|
|
@@ -432,10 +434,7 @@ class AbstractCommand {
|
|
|
432
434
|
if (this.registerOpts.requiresRegistry) {
|
|
433
435
|
var registryAlias;
|
|
434
436
|
var registry;
|
|
435
|
-
if (
|
|
436
|
-
registry = options.registry;
|
|
437
|
-
}
|
|
438
|
-
else if (this.args.registry) {
|
|
437
|
+
if (this.args.registry) {
|
|
439
438
|
registryAlias = registryAlias_1.RegistryAlias.get(this.args.registry);
|
|
440
439
|
}
|
|
441
440
|
else if (this.args.registryEndpoint) {
|
|
@@ -508,14 +507,10 @@ class AbstractCommand {
|
|
|
508
507
|
if (Commons.Logger.logger instanceof Commons.CliLogger || Commons.Logger.logger instanceof Commons.CliLogFileLogger) {
|
|
509
508
|
Commons.Logger.logger.forceStop();
|
|
510
509
|
}
|
|
511
|
-
return 0;
|
|
512
510
|
}
|
|
513
511
|
catch (e) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
return 1;
|
|
517
|
-
}
|
|
518
|
-
throw e;
|
|
512
|
+
yield (0, utils_1.logError)(e);
|
|
513
|
+
exitCode = 1;
|
|
519
514
|
}
|
|
520
515
|
finally {
|
|
521
516
|
if (Core.SystemConnector.systemConnector) {
|
|
@@ -532,6 +527,7 @@ class AbstractCommand {
|
|
|
532
527
|
const logFilePath = Commons.Logger.logger.getFilePath();
|
|
533
528
|
Commons.Logger.info(`Saved log output "${logFilePath}" for session ID ${sessionId}.`);
|
|
534
529
|
}
|
|
530
|
+
process.exit(exitCode);
|
|
535
531
|
}
|
|
536
532
|
});
|
|
537
533
|
}
|