Browse Source

new: provide ``option-get`` with possible interpolation.

hostresources
Valentin Lab 6 years ago
parent
commit
04d50750f5
  1. 12
      bin/compose-core

12
bin/compose-core

@ -1548,6 +1548,18 @@ yaml_get_interpret() {
export -f yaml_get_interpret
options-get () {
local key="$1" out
service_def=$(get_compose_service_def "$SERVICE_NAME") || return 1
if ! out=$(echo "$service_def" | shyaml -y get-value "options.$key" 2>/dev/null); then
err "The key $WHITE$key$NORMAL was not found in base service compose definition.."
return 1
fi
echo "$out" | yaml_get_interpret
}
export -f options-get
relation-base-compose-get () {
local key="$1" out
if ! out=$(echo "$RELATION_BASE_COMPOSE_DEF" | shyaml -y get-value "options.$key" 2>/dev/null); then

Loading…
Cancel
Save