forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1const {withXcodeProject} = require('@expo/config-plugins')
2const path = require('path')
3const fs = require('fs')
4
5const withExtensionViewController = (
6 config,
7 {controllerName, extensionName},
8) => {
9 // eslint-disable-next-line no-shadow
10 return withXcodeProject(config, config => {
11 const controllerPath = path.join(
12 config.modRequest.projectRoot,
13 'modules',
14 extensionName,
15 `${controllerName}.swift`,
16 )
17
18 const targetPath = path.join(
19 config.modRequest.platformProjectRoot,
20 extensionName,
21 `${controllerName}.swift`,
22 )
23
24 fs.mkdirSync(path.dirname(targetPath), {recursive: true})
25 fs.copyFileSync(controllerPath, targetPath)
26
27 return config
28 })
29}
30
31module.exports = {withExtensionViewController}