MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / writeFolder

Function writeFolder

modules/code-generator/src/publisher/disk/utils.ts:11–31  ·  view source on GitHub ↗
(
  folder: ResultDir,
  currentPath: string,
  createProjectFolder = true,
  fs: IFileSystem = systemFs,
)

Source from the content-addressed store, hash-verified

9}
10
11export const writeFolder = async (
12 folder: ResultDir,
13 currentPath: string,
14 createProjectFolder = true,
15 fs: IFileSystem = systemFs,
16): Promise<void> => {
17 const { name, files, dirs } = folder;
18
19 const folderPath = createProjectFolder ? join(currentPath, name) : currentPath;
20
21 if (!fs.existsSync(folderPath)) {
22 await createDirectory(folderPath, fs);
23 }
24
25 const promises = [
26 writeFilesToFolder(folderPath, files, fs),
27 writeSubFoldersToFolder(folderPath, dirs, fs),
28 ];
29
30 await Promise.all(promises);
31};
32
33const writeFilesToFolder = async (
34 folderPath: string,

Callers 2

publishFunction · 0.90
writeSubFoldersToFolderFunction · 0.85

Calls 3

createDirectoryFunction · 0.85
writeFilesToFolderFunction · 0.85
writeSubFoldersToFolderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…