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:
Gabriel Horner
2024-11-21 10:30:58 -05:00
parent cf3102b934
commit 8e81d7d855
3 changed files with 27 additions and 9 deletions

View File

@@ -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")))))