mobile-cli-lib
Version:
common lib used by different CLI
38 lines (37 loc) • 1.78 kB
JavaScript
"use strict";
var PostInstallCommand = (function () {
function PostInstallCommand($fs, $staticConfig, $commandsService, $htmlHelpService, $options, $doctorService, $analyticsService, $logger) {
this.$fs = $fs;
this.$staticConfig = $staticConfig;
this.$commandsService = $commandsService;
this.$htmlHelpService = $htmlHelpService;
this.$options = $options;
this.$doctorService = $doctorService;
this.$analyticsService = $analyticsService;
this.$logger = $logger;
this.disableAnalytics = true;
this.allowedParameters = [];
}
PostInstallCommand.prototype.execute = function (args) {
var _this = this;
return (function () {
if (process.platform !== "win32") {
if (process.env.SUDO_USER) {
_this.$fs.setCurrentUserAsOwner(_this.$options.profileDir, process.env.SUDO_USER).wait();
}
}
_this.$htmlHelpService.generateHtmlPages().wait();
var doctorResult = _this.$doctorService.printWarnings({ trackResult: false }).wait();
_this.$analyticsService.checkConsent().wait();
_this.$commandsService.tryExecuteCommand("autocomplete", []).wait();
_this.$analyticsService.track("InstallEnvironmentSetup", doctorResult ? "incorrect" : "correct").wait();
if (_this.$staticConfig.INSTALLATION_SUCCESS_MESSAGE) {
_this.$logger.out();
_this.$logger.printMarkdown(_this.$staticConfig.INSTALLATION_SUCCESS_MESSAGE);
}
}).future()();
};
return PostInstallCommand;
}());
exports.PostInstallCommand = PostInstallCommand;
$injector.registerCommand("dev-post-install", PostInstallCommand);