Merge pull request #91 from opencultureconsulting:felixlohmeier/info-9

elaborate info command
This commit is contained in:
Felix Lohmeier 2022-12-06 17:09:08 +01:00 committed by GitHub
commit 11473dc1c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

10
orcli
View File

@ -1121,9 +1121,17 @@ orcli_list_command() {
orcli_info_command() { orcli_info_command() {
# src/info_command.sh # src/info_command.sh
# shellcheck shell=bash disable=SC2154 # shellcheck shell=bash disable=SC2154
# get project id # get project id
projectid="$(get_id "${args[project]}")" 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 # :command.function

View File

@ -1,4 +1,11 @@
# shellcheck shell=bash disable=SC2154 # shellcheck shell=bash disable=SC2154
# get project id # get project id
projectid="$(get_id "${args[project]}")" 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