소스 검색

ref: post-build

Sv443 1 년 전
부모
커밋
5e4cd95e0f
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      tools/post-build-global.mts

+ 3 - 2
tools/post-build-global.mts

@@ -48,9 +48,10 @@ async function run() {
   setImmediate(() => exit(0));
 }
 
-async function exists(path: string) {
+/** Checks if a path exists / is readable and writable (by default) */
+async function exists(path: string, mode = fsconstants.R_OK | fsconstants.W_OK) {
   try {
-    await access(path, fsconstants.R_OK | fsconstants.W_OK);
+    await access(path, mode);
     return true;
   }
   catch(err) {