(subdir: string)
| 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 | } |
no test coverage detected