elaborate info command

This commit is contained in:
felixlohmeier 2022-12-06 16:08:43 +00:00
parent 3b56867f44
commit 22c537aa9b
2 changed files with 17 additions and 2 deletions

10
orcli
View File

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

View File

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