UNPKG

expo-updates

Version:

Fetches and manages remotely-hosted assets and updates to your app's JS bundle.

15 lines (12 loc) 309 B
import fs from 'fs'; import path from 'path'; export function findUpProjectRoot(cwd: string): string | null { if (['.', path.sep].includes(cwd)) { return null; } if (fs.existsSync(path.join(cwd, 'package.json'))) { return cwd; } else { return findUpProjectRoot(path.dirname(cwd)); } }