xref: /expo/tools/src/Directories.ts (revision eeffdb10)
1import path from 'path';
2import process from 'process';
3
4export function getExpoRepositoryRootDir(): string {
5  // EXPO_ROOT_DIR is set locally by direnv
6  return process.env.EXPO_ROOT_DIR || path.join(__dirname, '..', '..');
7}
8
9export function getExpoHomeJSDir(): string {
10  return path.join(getExpoRepositoryRootDir(), 'home');
11}
12
13export function getExpotoolsDir(): string {
14  return path.join(getExpoRepositoryRootDir(), 'tools');
15}
16
17export function getBinDir(): string {
18  return path.join(getExpotoolsDir(), 'bin');
19}
20
21export function getPackagesDir(): string {
22  return path.join(getExpoRepositoryRootDir(), 'packages');
23}
24
25export function getIosDir(): string {
26  return path.join(getExpoRepositoryRootDir(), 'ios');
27}
28
29export function getAndroidDir(): string {
30  return path.join(getExpoRepositoryRootDir(), 'android');
31}
32
33export function getTemplatesDir(): string {
34  return path.join(getExpoRepositoryRootDir(), 'templates');
35}
36
37export function getReactNativeSubmoduleDir(): string {
38  return path.join(getExpoRepositoryRootDir(), 'react-native-lab', 'react-native');
39}
40
41export function getVersionedReactNativeIosDir(): string {
42  return path.join(getIosDir(), 'versioned-react-native');
43}
44
45export function getAppsDir(): string {
46  return path.join(getExpoRepositoryRootDir(), 'apps');
47}
48