fix: display more helpful notifications for invalid

properties and classes that can't build a db-ident. Part of LOG-3176
This commit is contained in:
Gabriel Horner
2024-07-24 16:35:05 -04:00
parent 3411f344e3
commit 4b365da70c
5 changed files with 46 additions and 13 deletions

View File

@@ -131,12 +131,14 @@
[(node-path/join (os/homedir) "logseq" "graphs") db-graph-dir])
file-graph' (resolve-path file-graph)
conn (outliner-cli/init-conn dir db-name {:classpath (cp/get-classpath)})
directory? (.isDirectory (fs/statSync file-graph'))]
directory? (.isDirectory (fs/statSync file-graph'))
;; coerce option collection into strings
options' (if (:tag-classes options) (update options :tag-classes (partial mapv str)) options)]
(p/do!
(if directory?
(import-file-graph-to-db file-graph' (node-path/join dir db-name) conn (merge options {:graph-name db-name}))
(import-files-to-db file-graph' conn (merge options {:graph-name db-name})))
(when (:verbose options) (println "Transacted" (count (d/datoms @conn :eavt)) "datoms"))
(import-file-graph-to-db file-graph' (node-path/join dir db-name) conn (merge options' {:graph-name db-name}))
(import-files-to-db file-graph' conn (merge options' {:graph-name db-name})))
(when (:verbose options') (println "Transacted" (count (d/datoms @conn :eavt)) "datoms"))
(println "Created graph" (str db-name "!")))))
(when (= nbb/*file* (:file (meta #'-main)))