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