MCPcopy
hub / github.com/ionic-team/capacitor / readFile

Function readFile

cli/src/tasks/migrate.ts:434–444  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

432}
433
434function readFile(filename: string): string | undefined {
435 try {
436 if (!existsSync(filename)) {
437 logger.error(`Unable to find ${filename}. Try updating it manually`);
438 return;
439 }
440 return readFileSync(filename, 'utf-8');
441 } catch (err) {
442 logger.error(`Unable to read ${filename}. Verify it is not already open. ${err}`);
443 }
444}
445
446function getGradleWrapperVersion(filename: string): string {
447 const txt = readFile(filename);

Callers 15

readMethod · 0.85
copyPluginsJSFunction · 0.85
logiOSPlistFunction · 0.85
determineIOSWebDirAbsFunction · 0.85
determinePackageManagerFunction · 0.85
checkBuildGradleFunction · 0.85
getVariablesGradleFileFunction · 0.85
editProjectSettingsIOSFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected