Add fallback for dark hardware image (#3504)

This commit is contained in:
Franck Nijhof 2022-07-04 16:29:13 +02:00 committed by GitHub
parent e3d21c0f3e
commit 8efbe49ef5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,16 @@ rsync -aL --exclude '_homeassistant' --exclude '_placeholder' core_integrations/
# Copy hardware
rsync -aL hardware/ build/hardware
# Create fallback for dark hardware variants
find ./build/hardware -type f -name "*.png" | while read image; do
dir=$(dirname "${image}")
filename=$(basename -s .png "${image}")
if [[ ! -f "${dir}/dark_${filename}.png" ]]; then
cp "${image}" "${dir}/dark_${filename}.png"
echo "Using ${image} as dark_${filename}"
fi
done
# Generate icons based on MDI
find ./build -type f -name "icon.txt" | while read icon; do
dir=$(dirname "${icon}")