-
Notifications
You must be signed in to change notification settings - Fork 227
/
Copy pathpod-install.cjs
47 lines (42 loc) · 1.04 KB
/
pod-install.cjs
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
36
37
38
39
40
41
42
43
44
45
46
47
const child_process = require('child_process');
module.exports = {
name: 'pod-install',
factory() {
return {
hooks: {
afterAllInstalled(project, options) {
if (process.platform !== 'darwin') {
return;
}
if (process.env.PWD.includes('scripts/terra')) {
return;
}
if (process.env.POD_INSTALL === '0') {
return;
}
if (
options &&
(options.mode === 'update-lockfile' ||
options.mode === 'skip-build')
) {
return;
}
const result = child_process.spawnSync(
'yarn',
['pod-install', 'example/ios'],
{
cwd: project.cwd,
env: process.env,
stdio: 'inherit',
encoding: 'utf-8',
shell: true,
}
);
if (result.status !== 0) {
throw new Error('Failed to run pod-install');
}
},
},
};
},
};