mirror of https://github.com/logseq/logseq
Replace logo.png with svg
parent
c795ee408d
commit
9cafb596c9
|
@ -69,7 +69,6 @@
|
|||
|
||||
;; repo
|
||||
:repo/url {:db/unique :db.unique/identity}
|
||||
:repo/cloned? {}
|
||||
:git/latest-commit {}
|
||||
:git/status {}
|
||||
;; last error, better we should record all the errors
|
||||
|
@ -381,23 +380,6 @@
|
|||
react
|
||||
sort-by-pos)))
|
||||
|
||||
(defn mark-repo-as-cloned
|
||||
[repo-url]
|
||||
(transact!
|
||||
[{:repo/url repo-url
|
||||
:repo/cloned? true}]))
|
||||
|
||||
(defn cloned?
|
||||
[repo-url]
|
||||
(->
|
||||
(d/q '[:find ?cloned
|
||||
:in $ ?repo-url
|
||||
:where
|
||||
[?repo :repo/url ?repo-url]
|
||||
[?repo :repo/cloned? ?cloned]]
|
||||
(get-conn repo-url) repo-url)
|
||||
ffirst))
|
||||
|
||||
(defn get-page-name
|
||||
[file ast]
|
||||
(when-let [heading (first (filter block/heading-block? ast))]
|
||||
|
|
|
@ -43,6 +43,13 @@
|
|||
(write-file dir path initial-content)
|
||||
false))))
|
||||
|
||||
(defn file-exists?
|
||||
[dir path]
|
||||
(util/p-handle
|
||||
(stat dir path)
|
||||
(fn [_stat] true)
|
||||
(fn [_e] false)))
|
||||
|
||||
(comment
|
||||
(def dir "/notes")
|
||||
)
|
||||
|
|
|
@ -49,7 +49,8 @@
|
|||
content)
|
||||
(p/catch
|
||||
(fn [e]
|
||||
(prn "load file failed, " e)))))
|
||||
;; (prn "load file failed, " e)
|
||||
))))
|
||||
|
||||
(defn redirect!
|
||||
"If `push` is truthy, previous page will be left in history."
|
||||
|
@ -381,7 +382,6 @@
|
|||
(db/start-db-conn! (:me @state/state)
|
||||
repo-url
|
||||
db-listen-to-tx!)
|
||||
(db/mark-repo-as-cloned repo-url)
|
||||
(set-latest-commit-if-exists! repo-url)
|
||||
(util/post (str config/api "repos")
|
||||
{:url repo-url}
|
||||
|
@ -868,11 +868,14 @@
|
|||
(db/restore! me db-listen-to-tx!)
|
||||
(doseq [{:keys [id url]} repos]
|
||||
(let [repo url]
|
||||
(if (db/cloned? repo)
|
||||
(do
|
||||
(git-set-username-email! repo me)
|
||||
(periodically-pull-and-push repo {:pull-now? true}))
|
||||
(clone-and-pull repo))))
|
||||
(p/let [config-exists? (fs/file-exists?
|
||||
(git/get-repo-dir url)
|
||||
".git/config")]
|
||||
(if config-exists?
|
||||
(do
|
||||
(git-set-username-email! repo me)
|
||||
(periodically-pull-and-push repo {:pull-now? true}))
|
||||
(clone-and-pull repo)))))
|
||||
(watch-config!)))
|
||||
|
||||
(defn upload-image
|
||||
|
|
Loading…
Reference in New Issue