Fix bug with check_config and wrong yaml (#121)

This commit is contained in:
Pascal Vizeli
2017-06-19 22:41:44 +02:00
committed by GitHub
parent eb2e584bb8
commit 3caf9e2d14
2 changed files with 11 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "Check HomeAssistant config", "name": "Check HomeAssistant config",
"version": "0.4", "version": "0.5",
"slug": "check_config", "slug": "check_config",
"description": "Check HomeAssistant config with a new version", "description": "Check HomeAssistant config with a new version",
"url": "https://home-assistant.io/addons/check_config/", "url": "https://home-assistant.io/addons/check_config/",

View File

@@ -25,8 +25,16 @@ echo "[INFO] Install done, check config now"
cp -r /config /tmp/config > /dev/null cp -r /config /tmp/config > /dev/null
if ! HASS_OUTPUT="$(hass -c /tmp/config --script check_config)" if ! HASS_OUTPUT="$(hass -c /tmp/config --script check_config)"
then then
echo "[ERROR] Wrong config found: $HASS_OUTPUT" echo "[ERROR] Wrong config found!"
echo "$HASS_OUTPUT"
exit 1 exit 1
fi fi
echo "[INFO] Okay :)" if echo "$HASS_OUTPUT" | grep ERROR > /dev/null
then
echo "[ERROR] Wrong yaml found!"
echo "$HASS_OUTPUT"
exit 1
fi
echo "[INFO] Done"