Ver código fonte

enhance: backup db file when not matched

Tienson Qin 3 anos atrás
pai
commit
b025ce71d2
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      src/main/frontend/fs/node.cljs

+ 2 - 0
src/main/frontend/fs/node.cljs

@@ -69,6 +69,8 @@
         (->
          (p/let [result (ipc/ipc "writeFile" repo path content)
                  mtime (gobj/get result "mtime")]
+           (when-not contents-matched?
+             (ipc/ipc "backupDbFile" (config/get-local-dir repo) path db-content content))
            (db/set-file-last-modified-at! repo path mtime)
            (p/let [content (if (encrypt/encrypted-db? (state/get-current-repo))
                              (encrypt/decrypt content)