-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathframework.js
More file actions
executable file
·35 lines (31 loc) · 917 Bytes
/
Copy pathframework.js
File metadata and controls
executable file
·35 lines (31 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const { executeCommand } = require('../utils/commands');
const { log } = require('../utils/logger');
async function createProject(projectName, isExpo) {
if (isExpo) {
await executeCommand(
`npx create-expo-app@latest ${projectName} --template blank-typescript`,
);
} else {
await executeCommand(
`npx @react-native-community/cli@latest init ${projectName}`,
);
}
}
async function installIOSDependencies(projectPath) {
const path = require('path');
const fs = require('fs');
try {
const iosPath = path.join(projectPath, 'ios');
if (fs.existsSync(iosPath)) {
await executeCommand('cd ios && pod install && cd ..', { cwd: projectPath });
}
} catch (error) {
log.warning(
'Failed to run pod install. Please run "cd ios && pod install" manually before running on iOS.',
);
}
}
module.exports = {
createProject,
installIOSDependencies,
};