mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 23:54:55 +00:00
enhance: add :exclude-namespaces export option
Useful for graphs with existing ontologies to avoid noisy and needless exporting. Also update related scripts and noted that create script has always been able to also update
This commit is contained in:
11
deps/db/script/export_graph.cljs
vendored
11
deps/db/script/export_graph.cljs
vendored
@@ -32,11 +32,14 @@
|
||||
"Options spec"
|
||||
{:help {:alias :h
|
||||
:desc "Print help"}
|
||||
:timestamps {:alias :t
|
||||
:desc "Include timestamps in export"}
|
||||
:include-timestamps? {:alias :t
|
||||
:desc "Include timestamps in export"}
|
||||
:file {:alias :f
|
||||
:desc "Saves edn to file"}
|
||||
:export-options {:alias :e
|
||||
:exclude-namespaces {:alias :e
|
||||
:coerce #{}
|
||||
:desc "Namespaces to exclude from properties and classes"}
|
||||
:export-options {:alias :E
|
||||
:desc "Raw options map to pass to export"}})
|
||||
|
||||
(defn -main [args]
|
||||
@@ -48,7 +51,7 @@
|
||||
(js/process.exit 1))
|
||||
[dir db-name] (get-dir-and-db-name graph-dir)
|
||||
conn (sqlite-cli/open-db! dir db-name)
|
||||
export-options (merge {:include-timestamps? (:timestamps options)}
|
||||
export-options (merge (select-keys options [:include-timestamps? :exclude-namespaces])
|
||||
(edn/read-string (:export-options options)))
|
||||
export-map (sqlite-export/build-export @conn {:export-type :graph :graph-options export-options})]
|
||||
(when (:file options)
|
||||
|
||||
Reference in New Issue
Block a user