@nx/expo
Version:
36 lines (35 loc) • 1.24 kB
JavaScript
;
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`.');
}
}