Save global config edits

Also alert user if write fails
This commit is contained in:
Gabriel Horner
2022-09-01 11:45:41 -04:00
committed by Andelf
parent 9c0bb02dcd
commit 095a4ef1cd
5 changed files with 51 additions and 20 deletions

View File

@@ -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