Update 90-config_yaml.sh

This commit is contained in:
Alexandre
2022-01-27 05:24:01 +01:00
committed by GitHub
parent e9220c4e98
commit 46cfc7172e

View File

@@ -47,12 +47,10 @@ fi
# Helper function
function parse_yaml {
local prefix=$2 || local prefix=""
# spellcheck disable=SC2155
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
# spellcheck disable=SC1087
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" |
awk -F$fs '{