(files, destinationDirs)
| 41 | } |
| 42 | |
| 43 | async function copyFilesToDestinationDirs(files, destinationDirs) { |
| 44 | let count = 0; |
| 45 | for await (const filePath of files) { |
| 46 | const fullPath = path.join(srcDir, filePath); |
| 47 | |
| 48 | for (const destinationDir of destinationDirs) { |
| 49 | const destPath = path.join(destinationDir, filePath); |
| 50 | const destDir = path.dirname(destPath); |
| 51 | |
| 52 | // Attempt to create a directory if it doesn't exist yet |
| 53 | await fs.mkdir(destDir, { recursive: true }); |
| 54 | |
| 55 | await fs.copyFile(fullPath, destPath); |
| 56 | } |
| 57 | count++; |
| 58 | } |
| 59 | |
| 60 | return count; |
| 61 | } |
| 62 | |
| 63 | async function copyJsonFiles() { |
| 64 | const files = glob.globIterate('**/*.json', { |
no outgoing calls
no test coverage detected
searching dependent graphs…