UNPKG

@nx/expo

Version:

The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.

36 lines (35 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveEas = resolveEas; const child_process_1 = require("child_process"); function resolveEas(workspaceRoot) { try { (0, child_process_1.execSync)('eas --version'); } catch { throw new Error('EAS is not installed. Please run `npm install --global eas-cli` or `yarn global add eas-cli`.'); } let npmGlobalPath, yarnGlobalPath; try { npmGlobalPath = (0, child_process_1.execSync)('npm root -g', { windowsHide: false }) ?.toString() ?.trim() ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes } catch { } try { yarnGlobalPath = (0, child_process_1.execSync)('yarn global dir', { windowsHide: false }) ?.toString() ?.trim() ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes } catch { } try { return require.resolve('eas-cli/bin/run', { paths: [npmGlobalPath, yarnGlobalPath, workspaceRoot].filter(Boolean), }); } catch { throw new Error('Can not resolve EAS. Please run `npm install --global eas-cli` or `yarn global add eas-cli`.'); } }