mobile-cli-lib
Version:
common lib used by different CLI
32 lines (31 loc) • 1.35 kB
JavaScript
;
var os_1 = require("os");
var future = require("fibers/future");
var DoctorCommand = (function () {
function DoctorCommand($doctorService, $logger, $staticConfig) {
this.$doctorService = $doctorService;
this.$logger = $logger;
this.$staticConfig = $staticConfig;
this.allowedParameters = [];
}
DoctorCommand.prototype.canExecute = function (args) {
return future.fromResult(true);
};
DoctorCommand.prototype.execute = function (args) {
var _this = this;
return (function () {
var warningsPrinted = _this.$doctorService.printWarnings().wait();
if (warningsPrinted) {
var client = _this.$staticConfig.CLIENT_NAME_ALIAS || _this.$staticConfig.CLIENT_NAME;
_this.$logger.out(("When you file an issue, these warnings will help the " + client + " team to investigate, identify, and resolve the report.").bold
+ os_1.EOL + ("Please, ignore them if you are not experiencing any issues with " + client + ".").bold + os_1.EOL);
}
else {
_this.$logger.out("No issues were detected.".bold);
}
}).future()();
};
return DoctorCommand;
}());
exports.DoctorCommand = DoctorCommand;
$injector.registerCommand("doctor", DoctorCommand);