mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
feat(cli): add 'debug pull' cmd
This commit is contained in:
@@ -556,6 +556,57 @@
|
||||
:cleanup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json server stop --graph {{graph-arg}}"]
|
||||
:tags [:show :pipe]}
|
||||
|
||||
{:id "debug-pull-id-json"
|
||||
:setup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json graph create --graph {{graph-arg}} >/dev/null"
|
||||
"{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json upsert page --graph {{graph-arg}} --page Home >/dev/null"]
|
||||
:cmds ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json debug pull --graph {{graph-arg}} --id \"$({{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json query --graph {{graph-arg}} --query '[:find ?e . :where [?e :block/title \"Home\"]]' | python3 -c 'import sys,json; print(json.load(sys.stdin)[\"data\"][\"result\"])')\""]
|
||||
:expect {:exit 0
|
||||
:stdout-json-paths {[:status] "ok"
|
||||
[:data :entity :block/title] "Home"}}
|
||||
:covers {:commands ["debug pull"]
|
||||
:options {:global ["--config" "--graph" "--data-dir" "--output"]
|
||||
:debug ["--id"]}}
|
||||
:cleanup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json server stop --graph {{graph-arg}}"]
|
||||
:tags [:debug]}
|
||||
|
||||
{:id "debug-pull-uuid-json"
|
||||
:setup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json graph create --graph {{graph-arg}} >/dev/null"
|
||||
"{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json upsert page --graph {{graph-arg}} --page Home >/dev/null"]
|
||||
:cmds ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json debug pull --graph {{graph-arg}} --uuid \"$({{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json query --graph {{graph-arg}} --query '[:find ?uuid . :where [?e :block/title \"Home\"] [?e :block/uuid ?uuid]]' | python3 -c 'import sys,json; print(json.load(sys.stdin)[\"data\"][\"result\"])')\""]
|
||||
:expect {:exit 0
|
||||
:stdout-json-paths {[:status] "ok"
|
||||
[:data :entity :block/title] "Home"}}
|
||||
:covers {:commands ["debug pull"]
|
||||
:options {:global ["--config" "--graph" "--data-dir" "--output"]
|
||||
:debug ["--uuid"]}}
|
||||
:cleanup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json server stop --graph {{graph-arg}}"]
|
||||
:tags [:debug]}
|
||||
|
||||
{:id "debug-pull-ident-json"
|
||||
:setup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json graph create --graph {{graph-arg}} >/dev/null"]
|
||||
:cmds ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json debug pull --graph {{graph-arg}} --ident :logseq.class/Tag"]
|
||||
:expect {:exit 0
|
||||
:stdout-json-paths {[:status] "ok"
|
||||
[:data :entity :db/ident] "logseq.class/Tag"}}
|
||||
:covers {:commands ["debug pull"]
|
||||
:options {:global ["--config" "--graph" "--data-dir" "--output"]
|
||||
:debug ["--ident"]}}
|
||||
:cleanup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json server stop --graph {{graph-arg}}"]
|
||||
:tags [:debug]}
|
||||
|
||||
{:id "debug-pull-current-graph-fallback-json"
|
||||
:setup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json graph create --graph {{graph-arg}} >/dev/null"
|
||||
"{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json upsert page --graph {{graph-arg}} --page Home >/dev/null"]
|
||||
:cmds ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json debug pull --id \"$({{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json query --graph {{graph-arg}} --query '[:find ?e . :where [?e :block/title \"Home\"]]' | python3 -c 'import sys,json; print(json.load(sys.stdin)[\"data\"][\"result\"])')\""]
|
||||
:expect {:exit 0
|
||||
:stdout-json-paths {[:status] "ok"
|
||||
[:data :entity :block/title] "Home"}}
|
||||
:covers {:commands ["debug pull"]
|
||||
:options {:global ["--config" "--data-dir" "--output"]
|
||||
:debug ["--id"]}}
|
||||
:cleanup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json server stop --graph {{graph-arg}}"]
|
||||
:tags [:debug]}
|
||||
|
||||
{:id "remove-page-json"
|
||||
:setup ["{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json graph create --graph {{graph-arg}} >/dev/null"
|
||||
"{{cli}} --data-dir {{data-dir-arg}} --config {{config-path-arg}} --output json upsert page --graph {{graph-arg}} --page Home >/dev/null"]
|
||||
|
||||
Reference in New Issue
Block a user