elaborate info command
This commit is contained in:
parent
3b56867f44
commit
22c537aa9b
10
orcli
10
orcli
|
@ -1121,9 +1121,17 @@ orcli_list_command() {
|
|||
orcli_info_command() {
|
||||
# src/info_command.sh
|
||||
# shellcheck shell=bash disable=SC2154
|
||||
|
||||
# get project id
|
||||
projectid="$(get_id "${args[project]}")"
|
||||
echo "$projectid"
|
||||
|
||||
if ! response="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-project-metadata")"; then
|
||||
error "reading metadata of ${args[project]} failed!"
|
||||
else
|
||||
columns="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-models" | jq '[ .columnModel | .columns[] | .name ]')"
|
||||
jq "{ id: ${projectid} } + . + {columns: $columns }" <<<"$response"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# :command.function
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
# shellcheck shell=bash disable=SC2154
|
||||
|
||||
# get project id
|
||||
projectid="$(get_id "${args[project]}")"
|
||||
echo "$projectid"
|
||||
|
||||
if ! response="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-project-metadata")"; then
|
||||
error "reading metadata of ${args[project]} failed!"
|
||||
else
|
||||
columns="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-models" | jq '[ .columnModel | .columns[] | .name ]')"
|
||||
jq "{ id: ${projectid} } + . + {columns: $columns }" <<<"$response"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue