Config check: Fix grep for Errors on stdout (#158)

* Update run.sh

* remove tzdata while it is on base image

* Update config.json
This commit is contained in:
Pascal Vizeli
2017-07-31 17:13:01 +02:00
committed by GitHub
parent 2bc19cefb5
commit ccfa38096e
3 changed files with 8 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ FROM %%BASE_IMAGE%%
ENV LANG C.UTF-8
# Setup base
RUN apk add --no-cache tzdata jq python3 \
RUN apk add --no-cache jq python3 \
&& pip3 install --no-cache --upgrade pip
# Copy data

View File

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

View File

@@ -16,25 +16,25 @@ echo "[INFO] Start install HomeAssistant $VERSION"
if ! PIP_OUTPUT="$(pip3 install "$CMD")"
then
echo "[ERROR] Install HomeAssistant: $PIP_OUTPUT"
echo "[Error] Install HomeAssistant: $PIP_OUTPUT"
exit 1
fi
echo "[INFO] Install done, check config now"
echo "[Info] Install done, check config now"
cp -r /config /tmp/config > /dev/null
if ! HASS_OUTPUT="$(hass -c /tmp/config --script check_config)"
then
echo "[ERROR] Wrong config found!"
echo "[Error] Wrong config found!"
echo "$HASS_OUTPUT"
exit 1
fi
if echo "$HASS_OUTPUT" | grep ERROR > /dev/null
if echo "$HASS_OUTPUT" | grep -i ERROR > /dev/null
then
echo "[ERROR] Wrong yaml found!"
echo "[Error] Found error inside log output!"
echo "$HASS_OUTPUT"
exit 1
fi
echo "[INFO] Finish :)"
echo "[Info] Finish :)"