-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwithCSCAMasterList.js
31 lines (26 loc) · 1.04 KB
/
withCSCAMasterList.js
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
const { withXcodeProject, IOSConfig, withDangerousMod } = require('expo/config-plugins');
const path = require('path');
const fs = require('fs');
const withCSCAMasterList = (config) => {
config = withXcodeProject(config, async (config) => {
config.modResults = IOSConfig.XcodeUtils.addResourceFileToGroup({
filepath: path.join('..', 'assets', 'masterList.pem'),
groupName: config.modRequest.projectName,
// groupName: 'main',
project: config.modResults,
isBuildFile: true,
});
return config;
});
config = withDangerousMod(config, [
'android',
async (config) => {
const assetsDir = path.join(config.modRequest.platformProjectRoot, 'app', 'src', 'main', 'assets');
fs.mkdirSync(assetsDir, { recursive: true });
fs.copyFileSync(path.join('assets', 'masterList.pem'), path.join(assetsDir,'masterList.pem'));
return config;
}
])
return config;
};
module.exports = withCSCAMasterList;