MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / normalizeDevEcoRoot

Function normalizeDevEcoRoot

scripts/build-harmony-har.js:331–352  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

329}
330
331function normalizeDevEcoRoot(value) {
332 const resolved = path.resolve(value);
333 const basename = path.basename(resolved);
334
335 if (basename === 'sdk') {
336 return path.dirname(resolved);
337 }
338
339 if (basename === 'Contents') {
340 return resolved;
341 }
342
343 if (resolved.endsWith('.app')) {
344 return path.join(resolved, 'Contents');
345 }
346
347 if (fs.existsSync(path.join(resolved, 'Contents', 'tools'))) {
348 return path.join(resolved, 'Contents');
349 }
350
351 return resolved;
352}
353
354function resolveBinary(name, candidates) {
355 const explicitPath = findExistingPath(candidates);

Callers 1

getDevEcoRootsFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected