chmod tmp dir before cleanup

This should fix any permissions errors we get due to the ZIP file
containing files with different permissions.
This commit is contained in:
Koen Vlaswinkel
2023-12-19 15:27:07 +01:00
parent be4059864e
commit f1fe4a20f2

View File

@@ -1,7 +1,7 @@
import { createHash } from "crypto";
import { open } from "fs/promises";
import { join, relative, resolve, sep } from "path";
import { pathExists, readdir } from "fs-extra";
import { chmod, pathExists, readdir } from "fs-extra";
import { dir, DirectoryResult } from "tmp-promise";
import {
excludeDirectories,
@@ -98,6 +98,10 @@ describe("unzipToDirectory", () => {
});
afterEach(async () => {
for await (const file of walkDirectory(tmpDir.path)) {
await chmod(file, 0o777);
}
await tmpDir?.cleanup();
});