Browse Source

feat(electron): trying to fix custom.css

Tienson Qin 4 years ago
parent
commit
210ecc9353
2 changed files with 9 additions and 7 deletions
  1. 8 6
      src/main/frontend/fs.cljs
  2. 1 1
      src/main/frontend/handler/repo.cljs

+ 8 - 6
src/main/frontend/fs.cljs

@@ -115,12 +115,14 @@
 
 (defn mkdir-if-not-exists
   [dir]
-  (when dir
-    (util/p-handle
-     (stat dir nil)
-     (fn [_stat])
-     (fn [error]
-       (mkdir! dir)))))
+  (->
+   (when dir
+     (util/p-handle
+      (stat dir nil)
+      (fn [_stat])
+      (fn [error]
+        (mkdir! dir))))
+   (p/catch (fn [_error] nil))))
 
 (defn create-if-not-exists
   ([repo dir path]

+ 1 - 1
src/main/frontend/handler/repo.cljs

@@ -87,7 +87,7 @@
   [repo-url]
   (spec/validate :repos/url repo-url)
   (let [repo-dir (config/get-repo-dir repo-url)
-        path (config/get-custom-css-path)
+        path (str config/app-name "/" config/custom-css-file)
         file-path (str "/" path)
         default-content ""]
     (p/let [_ (fs/mkdir-if-not-exists (str repo-dir "/" config/app-name))