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 66 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x | import shell from 'shelljs'; import path from 'path'; import { commandExistsSync } from '../systemTools/exec'; import { logInfo, logDebug } from '../common'; import BasePlatformSetup from './base'; import { updateConfigFile, getRealPath } from '../systemTools/fileutils'; import setupConfig from './config'; import { CLI_ANDROID_ADB, CLI_ANDROID_AVDMANAGER, CLI_ANDROID_EMULATOR, CLI_ANDROID_SDKMANAGER } from '../constants'; class LinuxPlatformSetup extends BasePlatformSetup { constructor(c) { super('linux', c); } async installSoftware(software) { if (commandExistsSync('apt-get')) { await shell.exec(`apt-get -qq update && apt-get install ${software} -y > /dev/null`); } // @todo also treat other linux flavours return true; } async installPrereqs() { if (!this.availableDownloader) { logInfo('Looks like you don\'t have wget or curl installed. We\'ll install wget for you'); await this.installSoftware('wget'); this.availableDownloader = 'wget'; } if (!commandExistsSync('unzip')) { logInfo('Looks like you don\'t have unzip installed. We\'ll install it for you'); await this.installSoftware('unzip'); } if (!commandExistsSync('javac')) { logInfo('Looks like you don\'t have java installed. We\'ll install it for you'); await this.installSoftware('openjdk-8-jdk'); } return true; } async postInstall(sdk) { if (sdk === 'android') { const { location } = setupConfig.android; logDebug(`Updating ${this.globalConfigPath} with ${JSON.stringify({ androidSdk: location })}`); await updateConfigFile({ androidSdk: location }, this.globalConfigPath); // @todo find a more elegant way to update this this.c.files.workspace.config.sdks.ANDROID_SDK = location; const { sdks: { ANDROID_SDK } } = this.c.files.workspace.config; this.c.cli[CLI_ANDROID_EMULATOR] = getRealPath(this.c, path.join(ANDROID_SDK, 'emulator/emulator')); this.c.cli[CLI_ANDROID_ADB] = getRealPath(this.c, path.join(ANDROID_SDK, 'platform-tools/adb')); this.c.cli[CLI_ANDROID_AVDMANAGER] = getRealPath(this.c, path.join(ANDROID_SDK, 'tools/bin/avdmanager')); this.c.cli[CLI_ANDROID_SDKMANAGER] = getRealPath(this.c, path.join(ANDROID_SDK, 'tools/bin/sdkmanager')); } } } export default LinuxPlatformSetup; |