MCPcopy Index your code
hub / github.com/react-native-community/cli / writeFiles

Function writeFiles

jest/helpers.ts:61–77  ·  view source on GitHub ↗
(
  directory: string,
  files: {[filename: string]: string | NodeJS.ArrayBufferView},
)

Source from the content-addressed store, hash-verified

59 * );
60 */
61export const writeFiles = (
62 directory: string,
63 files: {[filename: string]: string | NodeJS.ArrayBufferView},
64) => {
65 createDirectory(directory);
66 Object.keys(files).forEach((fileOrPath) => {
67 const dirname = path.dirname(fileOrPath);
68
69 if (dirname !== '/') {
70 createDirectory(path.join(directory, dirname));
71 }
72 fs.writeFileSync(
73 path.resolve(directory, ...fileOrPath.split('/')),
74 files[fileOrPath],
75 );
76 });
77};
78
79export const copyDir = (src: string, dest: string) => {
80 const srcStat = fs.lstatSync(src);

Callers 14

createTempFilesFunction · 0.90
linkAssets.test.tsFile · 0.90
index-test.tsFile · 0.90
clean.test.tsFile · 0.90
androidSDK.test.tsFile · 0.90
root.test.tsFile · 0.90
unknown.test.tsFile · 0.90
init.test.tsFile · 0.90

Calls

no outgoing calls

Tested by 2

createTempFilesFunction · 0.72