1import spawnAsync from '@expo/spawn-async'; 2import process from 'process'; 3 4import { EXPO_DIR } from './Constants'; 5 6type Options = { 7 cwd?: string; 8 stdio?: 'inherit' | 'pipe' | 'ignore'; 9}; 10 11export async function runExpoCliAsync( 12 command: string, 13 args: string[] = [], 14 options: Options = {} 15): Promise<void> { 16 // Don't handle SIGINT/SIGTERM in this process...defer to expo-cli 17 process.on('SIGINT', () => {}); 18 process.on('SIGTERM', () => {}); 19 20 await spawnAsync('expo', [command, ...args], { 21 cwd: options.cwd || EXPO_DIR, 22 stdio: options.stdio || 'inherit', 23 env: { 24 ...process.env, 25 EXPO_NO_DOCTOR: 'true', 26 }, 27 }); 28} 29