# All files / dist/setupTools linux.js

25.35% Statements 18/71
0% Branches 0/25
12.5% Functions 1/8
25% Lines 8/32

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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
    664x
    4x

    4x

    4x

    4x

    4x

    4x

    4x
     var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _shelljs=_interopRequireDefault(require("shelljs"));
    var _path=_interopRequireDefault(require("path"));

    var _exec=require("../systemTools/exec");
    var _common=require("../common");
    var _base=_interopRequireDefault(require("./base"));
    var _fileutils=require("../systemTools/fileutils");
    var _config=_interopRequireDefault(require("./config"));
    var _constants=require("../constants");var

    LinuxPlatformSetup=function(_BasePlatformSetup){(0,_inherits2.default)(LinuxPlatformSetup,_BasePlatformSetup);
    function LinuxPlatformSetup(c){(0,_classCallCheck2.default)(this,LinuxPlatformSetup);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(LinuxPlatformSetup).call(this,
    'linux',c));
    }(0,_createClass2.default)(LinuxPlatformSetup,[{key:"installSoftware",value:function installSoftware(

    software){return _regenerator.default.async(function installSoftware$(_context){while(1){switch(_context.prev=_context.next){case 0:if(!
    (0,_exec.commandExistsSync)('apt-get')){_context.next=3;break;}_context.next=3;return _regenerator.default.awrap(
    _shelljs.default.exec("apt-get -qq update && apt-get install "+software+" -y > /dev/null"));case 3:return _context.abrupt("return",

    true);case 4:case"end":return _context.stop();}}});}},{key:"installPrereqs",value:function installPrereqs(){return _regenerator.default.async(function installPrereqs$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:if(

    this.availableDownloader){_context2.next=5;break;}
    (0,_common.logInfo)('Looks like you don\'t have wget or curl installed. We\'ll install wget for you');_context2.next=4;return _regenerator.default.awrap(
    this.installSoftware('wget'));case 4:
    this.availableDownloader='wget';case 5:if(

    (0,_exec.commandExistsSync)('unzip')){_context2.next=9;break;}
    (0,_common.logInfo)('Looks like you don\'t have unzip installed. We\'ll install it for you');_context2.next=9;return _regenerator.default.awrap(
    this.installSoftware('unzip'));case 9:if(

    (0,_exec.commandExistsSync)('javac')){_context2.next=13;break;}
    (0,_common.logInfo)('Looks like you don\'t have java installed. We\'ll install it for you');_context2.next=13;return _regenerator.default.awrap(
    this.installSoftware('openjdk-8-jdk'));case 13:return _context2.abrupt("return",

    true);case 14:case"end":return _context2.stop();}}},null,this);}},{key:"postInstall",value:function postInstall(

    sdk){var location,ANDROID_SDK;return _regenerator.default.async(function postInstall$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:if(!(
    sdk==='android')){_context3.next=11;break;}
    location=_config.default.android.location;
    (0,_common.logDebug)("Updating "+this.globalConfigPath+" with "+JSON.stringify({androidSdk:location}));_context3.next=5;return _regenerator.default.awrap(
    (0,_fileutils.updateConfigFile)({androidSdk:location},this.globalConfigPath));case 5:

    this.c.files.private.config.sdks.ANDROID_SDK=location;
    ANDROID_SDK=this.c.files.private.config.sdks.ANDROID_SDK;
    this.c.cli[_constants.CLI_ANDROID_EMULATOR]=_path.default.join(ANDROID_SDK,'emulator/emulator');
    this.c.cli[_constants.CLI_ANDROID_ADB]=_path.default.join(ANDROID_SDK,'platform-tools/adb');
    this.c.cli[_constants.CLI_ANDROID_AVDMANAGER]=_path.default.join(ANDROID_SDK,'tools/bin/avdmanager');
    this.c.cli[_constants.CLI_ANDROID_SDKMANAGER]=_path.default.join(ANDROID_SDK,'tools/bin/sdkmanager');case 11:case"end":return _context3.stop();}}},null,this);}}]);return LinuxPlatformSetup;}(_base.default);var _default=

    LinuxPlatformSetup;exports.default=_default;
    //# sourceMappingURL=linux.js.map