diff --git a/hooks/environment b/hooks/environment index b3e11e7..09cdb20 100755 --- a/hooks/environment +++ b/hooks/environment @@ -46,10 +46,11 @@ function read_meta_data() { meta_data_key_alias=${key_mapped[1]:-} mapped_key=${meta_data_key_alias:-$meta_data_key} value=$(buildkite-agent meta-data get "$meta_data_key") + value=$(echo "${value}" | tr '\n' " " | sed 's/ *$//') if [[ -n "$value" ]]; then echo "${mapped_key}=(${#value} chars)" >&2; - echo "${mapped_key}=${value}" + echo "${mapped_key}=\"${value}\"" else echo "Could not read meta-data: ${meta_data_key}" >&2; exit 1