Skip to content

Commit

Permalink
Add || true to handle case where drivers dir is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Oct 8, 2024
1 parent 14825f1 commit 7f8533d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wmbusmeters-ha-addon-edge/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ then
mkdir -p /data/drivers
fi
rm -rf ${CONFIG_DATA_PATH}/etc/wmbusmeters.drivers.d/*
cp /data/drivers/* ${CONFIG_DATA_PATH}/etc/wmbusmeters.drivers.d/
cp /data/drivers/* ${CONFIG_DATA_PATH}/etc/wmbusmeters.drivers.d/ || true

echo -e "$CONFIG_CONF" | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' > $CONFIG_DATA_PATH/etc/wmbusmeters.conf

Expand Down Expand Up @@ -75,7 +75,7 @@ do
meter_no=$(( meter_no+1 ))
METER_NAME=$(printf 'meter-%04d' "$(( meter_no ))")
bashio::log.info "Adding $METER_NAME ..."
METER_DATA=$(printf '%s\n' $meter | jq --raw-output -c -M '.')
METER_DATA=$(printf '%s\n' $meter | jq --raw-output -c -M '.')
echo -e "$METER_DATA" | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' > $CONFIG_DATA_PATH/etc/wmbusmeters.d/$METER_NAME
done

Expand Down

0 comments on commit 7f8533d

Please sign in to comment.