MCPcopy
hub / github.com/pingcap/docs-cn / getAllFiles

Function getAllFiles

scripts/utils.js:132–146  ·  view source on GitHub ↗
(dirPath, arrayOfFiles)

Source from the content-addressed store, hash-verified

130};
131
132const getAllFiles = (dirPath, arrayOfFiles) => {
133 const files = fs.readdirSync(dirPath);
134
135 arrayOfFiles = arrayOfFiles || [];
136
137 files.forEach((file) => {
138 if (fs.statSync(dirPath + "/" + file).isDirectory()) {
139 arrayOfFiles = getAllFiles(dirPath + "/" + file, arrayOfFiles);
140 } else {
141 arrayOfFiles.push(path.join(dirPath, "/", file));
142 }
143 });
144
145 return arrayOfFiles;
146};
147
148export const copyDirectorySync = (srcPath, destPath) => {
149 const allFiles = getAllFiles(srcPath);

Callers 2

copyDirectorySyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected