fix(fs): editing global config on windows

pull/9945/head
Andelf 2023-07-27 12:03:26 +08:00
parent 3406795066
commit 90db107e4d
1 changed files with 5 additions and 5 deletions

View File

@ -80,12 +80,12 @@
[path format] (:rum/args state)
repo-dir (config/get-repo-dir (state/get-current-repo))
[dir path] (cond
;; assume local file, relative path
(not (string/starts-with? path "/"))
[repo-dir path]
(path/absolute? path)
[nil path]
:else ;; global file on native platform
[nil path])]
;; assume local file, relative path
:else
[repo-dir path])]
(when (and format (contains? (gp-config/text-formats) format))
(p/let [content (fs/read-file dir path)]
(reset! *content (or content ""))))