fix: git-add immediately after creating file

This commit is contained in:
Yukun Guo
2020-12-10 10:40:31 +08:00
committed by Tienson Qin
parent 8963e23766
commit 06de25993c
2 changed files with 6 additions and 7 deletions

View File

@@ -456,10 +456,9 @@
(or (:page/original-name page)
(:page/name page)))
(text/remove-level-spaces value (keyword format)))]
(p/let [_ (fs/create-if-not-exists dir file-path content)]
(p/let [_ (fs/create-if-not-exists dir file-path content)
_ (git-handler/git-add repo path)]
(db/reset-file! repo path content)
(git-handler/git-add repo path)
(ui-handler/re-render-root!)
;; Continue to edit the last block
@@ -695,13 +694,13 @@
(let [content (util/default-content-with-title format (or
(:page/original-name page)
(:page/name page)))]
(p/let [_ (fs/create-if-not-exists dir file-path content)]
(p/let [_ (fs/create-if-not-exists dir file-path content)
_ (git-handler/git-add repo path)]
(db/reset-file! repo path
(str content
(text/remove-level-spaces value (keyword format))
"\n"
snd-block-text))
(git-handler/git-add repo path)
(ui-handler/re-render-root!)
;; Continue to edit the last block