MCPcopy
hub / github.com/zoontek/react-native-bootsplash / getIOSOutputPath

Function getIOSOutputPath

src/extras/generate.ts:83–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81};
82
83const getIOSOutputPath = () => {
84 const podfile = glob
85 .sync("**/Podfile", {
86 cwd: projectRoot.replace(/^([a-zA-Z]+:|\.\/)/, ""),
87 deep: 10,
88 ignore: ["**/@(Pods|node_modules|Carthage|vendor|android)/**"],
89 })
90 .find((project) => {
91 return path.dirname(project) === "ios";
92 });
93
94 if (!podfile) {
95 return;
96 }
97
98 const sourceDir = path.dirname(path.join(projectRoot, podfile));
99
100 const xcodeProjectName = fs
101 .readdirSync(sourceDir)
102 .sort()
103 .reverse()
104 .find((fileName) => {
105 const ext = path.extname(fileName);
106 return ext === ".xcodeproj" || ext === ".xcworkspace";
107 });
108
109 if (xcodeProjectName == null) {
110 log.warn("No Xcode project found. Skipping iOS assets generation…");
111 return;
112 }
113
114 const iosOutputPath = path
115 .resolve(sourceDir, xcodeProjectName)
116 .replace(/\.(xcodeproj|xcworkspace)$/, "");
117
118 if (hfs.exists(iosOutputPath)) {
119 return iosOutputPath;
120 }
121
122 log.warn(
123 `No ${path.relative(
124 cwd,
125 iosOutputPath,
126 )} directory found. Skipping iOS assets generation…`,
127 );
128};
129
130const getHtmlTemplatePath = ({ html }: { html: string }) => {
131 const htmlTemplatePath = path.resolve(cwd, html);

Callers 1

generateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…