Преглед изворни кода

fix: make sure file exists before checking permissions

Tienson Qin пре 4 година
родитељ
комит
cd1f68b741
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/electron/electron/handler.cljs

+ 1 - 1
src/electron/electron/handler.cljs

@@ -82,7 +82,7 @@
     (let [^js Buf (.-Buffer buffer)
           ^js content (if (instance? js/ArrayBuffer content)
                         (.from Buf content) content)]
-      (when-not (writable? path)
+      (when (and (fs/existsSync path) (not (writable? path)))
         (fs/chmodSync path "644"))
       (fs/writeFileSync path content)
       (fs/statSync path))