mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
enhance(dev): task to import multiple file graphs easily
Also add a --continue option to see all errors on a CLI import
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
[clojure.pprint :as pp]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.data :as data]
|
||||
[clojure.core.async :as async]))
|
||||
[clojure.core.async :as async]
|
||||
[clojure.string :as string]))
|
||||
|
||||
(defn test
|
||||
"Run tests. Pass args through to cmd 'yarn cljs:run-test'"
|
||||
@@ -100,3 +101,13 @@
|
||||
(do (println "Waiting for publishing frontend to build...")
|
||||
(Thread/sleep 1000)
|
||||
(recur (inc n)))))))
|
||||
|
||||
(defn db-import-many
|
||||
[& args]
|
||||
(let [parent-graph-dir "./out"
|
||||
[file-graphs import-options] (split-with #(not (string/starts-with? % "-")) args)]
|
||||
(doseq [file-graph file-graphs]
|
||||
(let [db-graph (fs/path parent-graph-dir (fs/file-name file-graph))]
|
||||
(println "Importing" (str db-graph) "...")
|
||||
(apply shell "bb" "dev:db-import" file-graph db-graph import-options)
|
||||
(shell "bb" "dev:validate-db" db-graph "-gHc")))))
|
||||
Reference in New Issue
Block a user