Skip to content

Commit 9a2cd5f

Browse files
authored
Merge pull request #3 from nil1511/patch-1
Fix copy for assets dir introduced in playwright 1.32
2 parents c4c3a13 + 9bdc690 commit 9a2cd5f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/merge-reports.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { createWriteStream, existsSync } from "fs";
18-
import { mkdir, readFile, readdir, copyFile, appendFile, writeFile, rm } from "fs/promises";
18+
import { mkdir, readFile, readdir, copyFile, appendFile, writeFile, rm, stat } from "fs/promises";
1919
import path from "path";
2020
import JSZip from "jszip";
2121
import yazl from "yazl";
@@ -219,6 +219,12 @@ async function copyDir(srcDirPath: string, srcDirOutputPath: string, debug: bool
219219
destPath
220220
});
221221
}
222+
223+
const fileStats = await stat(srcPath);
224+
if(fileStats.isDirectory()){
225+
return copyDir(srcPath, destPath, debug);
226+
}
227+
222228
await copyFile(srcPath, destPath);
223229
if (debug) {
224230
console.log(fileName);

0 commit comments

Comments
 (0)