MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / copyFiles

Function copyFiles

packages/vite/src/copyAssetsPlugin.ts:94–115  ·  view source on GitHub ↗
(subdir: string)

Source from the content-addressed store, hash-verified

92 }
93
94 async function copyFiles(subdir: string): Promise<void> {
95 const fullDir = path.join(alphaTabSourceDir!, subdir);
96
97 const files = await fs.promises.readdir(fullDir, {
98 withFileTypes: true
99 });
100
101 await fs.promises.mkdir(path.join(outputPath, subdir), {
102 recursive: true
103 });
104
105 await Promise.all(
106 files
107 .filter(f => f.isFile())
108 .map(async file => {
109 // node v20.12.0 has parentPath pointing to the path (not the file)
110 // see https://github.com/nodejs/node/pull/50976
111 const sourceFilename = path.join(file.parentPath ?? (file as any).path, file.name);
112 await fs.promises.copyFile(sourceFilename, path.join(outputPath!, subdir, file.name));
113 })
114 );
115 }
116
117 await Promise.all([copyFiles('font'), copyFiles('soundfont')]);
118 }

Callers 2

buildStartFunction · 0.85
_configureAssetCopyMethod · 0.85

Calls 3

filterMethod · 0.80
joinMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected