Bladeren bron

fix: r&w flags for exists()

Sven 1 jaar geleden
bovenliggende
commit
d16abb0402
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      src/tools/post-build.ts

+ 2 - 2
src/tools/post-build.ts

@@ -1,4 +1,4 @@
-import { access, readFile, writeFile } from "fs/promises";
+import { access, readFile, writeFile, constants as fsconstants } from "fs/promises";
 import { dirname, join, relative } from "path";
 import { fileURLToPath } from "url";
 import { exec } from "child_process";
@@ -171,7 +171,7 @@ function getLastCommitSha() {
 
 async function exists(path: string) {
   try {
-    await access(path);
+    await access(path, fsconstants.R_OK | fsconstants.W_OK);
     return true;
   }
   catch(err) {