1
0
Эх сурвалжийг харах

refactor: better way to check page file type

charlie 3 жил өмнө
parent
commit
b1b8405217

+ 1 - 2
src/main/frontend/fs.cljs

@@ -74,8 +74,7 @@
   [repo dir path content opts]
   (when content
     (let [fs-record (get-fs dir)]
-      (p/let [md-or-org? (or (string/ends-with? path ".md")
-                             (string/ends-with? path ".org"))
+      (p/let [md-or-org? (contains? #{"md" "markdown" "org"} (util/get-file-ext path))
               content (if-not md-or-org? content (encrypt/encrypt content))]
         (->
          (p/let [_ (protocol/write-file! (get-fs dir) repo dir path content opts)]