#tools/yq
Install yq for handy work with yaml
yml2env() {
yq --unwrapScalar=false --output-format=props "${1:-.} | (.. | select((tag == \"\!\!map\" or tag == \"\!\!seq\") and length == 0)) = \"\" | ... comments=\"\"" | awk '{gsub(/\./,"_",$1)} {$1=toupper($1);print}' | sed 's/ = /=/g'
}