Code coverage report for lib/common/static-config-base.js

Statements: 53.49% (23 / 43)      Branches: 0% (0 / 6)      Functions: 20% (2 / 10)      Lines: 53.49% (23 / 43)      Ignored: none     

All files » lib/common/ » static-config-base.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78    1 1 1 70 70 70 70 70 70 70 70 70 70 70 70   1             1                 1             1             1             1                                     1   1  
///<reference path=".d.ts"/>
"use strict";
var path = require("path");
var StaticConfigBase = (function () {
    function StaticConfigBase($injector) {
        this.$injector = $injector;
        this.PROJECT_FILE_NAME = null;
        this.CLIENT_NAME = null;
        this.ANALYTICS_API_KEY = null;
        this.ANALYTICS_INSTALLATION_ID_SETTING_NAME = null;
        this.TRACK_FEATURE_USAGE_SETTING_NAME = null;
        this.ERROR_REPORT_SETTING_NAME = null;
        this.APP_RESOURCES_DIR_NAME = "App_Resources";
        this.COMMAND_HELP_FILE_NAME = 'command-help.json';
        this.RESOURCE_DIR_PATH = __dirname;
        this.version = null;
        this._adbFilePath = null;
    }
    Object.defineProperty(StaticConfigBase.prototype, "helpTextPath", {
        get: function () {
            return null;
        },
        enumerable: true,
        configurable: true
    });
    StaticConfigBase.prototype.getAdbFilePath = function () {
        var _this = this;
        return (function () {
            if (!_this._adbFilePath) {
                _this._adbFilePath = _this.getAdbFilePathCore().wait();
            }
            return _this._adbFilePath;
        }).future()();
    };
    Object.defineProperty(StaticConfigBase.prototype, "MAN_PAGES_DIR", {
        get: function () {
            return path.join(__dirname, "../../", "docs", "man_pages");
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StaticConfigBase.prototype, "HTML_PAGES_DIR", {
        get: function () {
            return path.join(__dirname, "../../", "docs", "html");
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StaticConfigBase.prototype, "HTML_COMMON_HELPERS_DIR", {
        get: function () {
            return path.join(__dirname, "docs", "helpers");
        },
        enumerable: true,
        configurable: true
    });
    StaticConfigBase.prototype.getAdbFilePathCore = function () {
        var _this = this;
        return (function () {
            var defaultAdbFilePath = path.join(__dirname, "resources/platform-tools/android/" + process.platform + "/adb");
            var $childProcess = _this.$injector.resolve("$childProcess");
            try {
                var proc = $childProcess.spawnFromEvent("adb", ["version"], "exit", undefined, { throwError: false }).wait();
                if (proc.stderr) {
                    return defaultAdbFilePath;
                }
            }
            catch (e) {
                if (e.code === "ENOENT") {
                    return defaultAdbFilePath;
                }
            }
            return "adb";
        }).future()();
    };
    return StaticConfigBase;
})();
exports.StaticConfigBase = StaticConfigBase;