mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 23:54:55 +00:00
Save global config edits
Also alert user if write fails
This commit is contained in:
@@ -50,10 +50,15 @@
|
||||
(hidden? path patterns))) files)
|
||||
files))
|
||||
|
||||
;; TODO: Rename to get-repo-config-content
|
||||
(defn get-config
|
||||
[repo-url]
|
||||
(db/get-file repo-url (config/get-config-path)))
|
||||
|
||||
(defn get-global-config-content
|
||||
[repo-url]
|
||||
(db/get-file repo-url (config/get-global-config-path)))
|
||||
|
||||
(defn safe-read-string
|
||||
[content error-message-or-handler]
|
||||
(try
|
||||
@@ -79,6 +84,12 @@
|
||||
(state/set-config! repo-url config)
|
||||
config)))
|
||||
|
||||
(defn reset-global-config!
|
||||
[content]
|
||||
(let [config (reader/read-string content)]
|
||||
(state/set-global-config! config)
|
||||
config))
|
||||
|
||||
(defn read-metadata!
|
||||
[content]
|
||||
(try
|
||||
|
||||
Reference in New Issue
Block a user