UNPKG

eas-cli

Version:
62 lines (61 loc) 2.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const eas_build_job_1 = require("@expo/eas-build-job"); const chalk_1 = tslib_1.__importDefault(require("chalk")); const envinfo_1 = tslib_1.__importDefault(require("envinfo")); const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand")); const log_1 = tslib_1.__importDefault(require("../log")); const ora_1 = require("../ora"); const workflow_1 = require("../project/workflow"); const easCli_1 = require("../utils/easCli"); class Diagnostics extends EasCommand_1.default { static description = 'display environment info'; static contextDefinition = { ...this.ContextOptions.ProjectDir, ...this.ContextOptions.Vcs, }; async runAsync() { const { projectDir, vcsClient } = await this.getContextAsync(Diagnostics, { nonInteractive: true, }); const spinner = (0, ora_1.ora)().start(`Gathering diagnostic information...`); const info = await envinfo_1.default.run({ System: ['OS', 'Shell'], Binaries: ['Node', 'Yarn', 'npm'], Utilities: ['Git'], npmPackages: [ 'expo', 'expo-cli', 'react', 'react-dom', 'react-native', 'react-native-web', 'react-navigation', '@expo/webpack-config', 'expo-dev-client', 'expo-updates', ], npmGlobalPackages: ['eas-cli', 'expo-cli'], }, { title: chalk_1.default.bold(`EAS CLI ${easCli_1.easCliVersion} environment info`), }); spinner.succeed('All needed information gathered!'); log_1.default.log(info.trimEnd()); await this.printWorkflowAsync(projectDir, vcsClient); log_1.default.newLine(); } async printWorkflowAsync(projectDir, vcsClient) { const androidWorkflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient); const iosWorkflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient); if (androidWorkflow === iosWorkflow) { log_1.default.log(` Project workflow: ${androidWorkflow}`); } else { log_1.default.log(` Project workflow:`); log_1.default.log(` Android: ${androidWorkflow}`); log_1.default.log(` iOS: ${iosWorkflow}`); } } } exports.default = Diagnostics;