mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
correct yamllint
This commit is contained in:
@@ -30,7 +30,7 @@ fi
|
||||
|
||||
# Check if yaml is valid
|
||||
EXIT_CODE=0
|
||||
yamllint -d relaxed --no-warnings $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
|
||||
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
|
||||
if [ $EXIT_CODE = 0 ]; then
|
||||
echo "Config file is a valid yaml"
|
||||
else
|
||||
@@ -45,10 +45,10 @@ function parse_yaml {
|
||||
local prefix=$2 || local prefix=""
|
||||
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
|
||||
sed -ne "s|^\($s\):|\1|" \
|
||||
-e "s| #.*$||g" \
|
||||
-e "s|#.*$||g" \
|
||||
-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 |
|
||||
-e "s| #.*$||g" \
|
||||
-e "s|#.*$||g" \
|
||||
-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 '{
|
||||
indent = length($1)/2;
|
||||
vname[indent] = $2;
|
||||
@@ -86,7 +86,7 @@ while IFS= read -r line; do
|
||||
sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || true
|
||||
sed -i "1a export $line" /scripts/*run* 2>/dev/null || true
|
||||
# Show in log
|
||||
if ! bashio::config.false "verbose";then bashio::log.blue "$line"; fi
|
||||
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
|
||||
else
|
||||
bashio::exit.nok "$line does not follow the correct structure. Please check your yaml file."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user