Projects / bootwitch-cli-code-excerpts-metadata
Reading project metadata
bootwitch-clidevtools-and-workflows
The toolkit uses a small set of project fields. This excerpt shows how it reads those values as text and makes them available to the rest of the workflow.
bootwitch_config_get() {
config_file=$1
config_key=$2
case "$config_key" in
BOOTWITCH_SCHEMA | PROJECT_NAME | TEMPLATE | CREATED_DATE | BOOTWITCH_VERSION) ;;
*) return 2 ;;
esac
awk -F= -v wanted="$config_key" '
$1 == wanted && !found {
value = substr($0, length($1) + 2)
sub(/\r$/, "", value)
print value
found = 1
}
END { if (!found) exit 1 }
' "$config_file"
}
Read the full source · Snapshot 7bce28e8b273.