mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add support for dynamic frontend panels
This commit is contained in:
@@ -2,36 +2,21 @@
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
cd homeassistant/components/frontend/www_static/home-assistant-polymer
|
||||
cd homeassistant/components/frontend/www_static
|
||||
rm -rf core.js* frontend.html* webcomponents-lite.min.js* panels
|
||||
cd home-assistant-polymer
|
||||
npm run clean
|
||||
npm run frontend_prod
|
||||
|
||||
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
|
||||
cp build/frontend.html ..
|
||||
gzip build/frontend.html -c -k -9 > ../frontend.html.gz
|
||||
cp build/partial-map.html ..
|
||||
gzip build/partial-map.html -c -k -9 > ../partial-map.html.gz
|
||||
cp build/dev-tools.html ..
|
||||
gzip build/dev-tools.html -c -k -9 > ../dev-tools.html.gz
|
||||
cp build/_core_compiled.js ../core.js
|
||||
gzip build/_core_compiled.js -c -k -9 > ../core.js.gz
|
||||
|
||||
cp -r build/* ..
|
||||
node script/sw-precache.js
|
||||
cp build/service_worker.js ..
|
||||
gzip build/service_worker.js -c -k -9 > ../service_worker.js.gz
|
||||
|
||||
cd ..
|
||||
|
||||
gzip -f -k -9 *.html *.js ./panels/*.html
|
||||
|
||||
# Generate the MD5 hash of the new frontend
|
||||
cd ../..
|
||||
echo '"""DO NOT MODIFY. Auto-generated by build_frontend script."""' > version.py
|
||||
if [ $(command -v md5) ]; then
|
||||
echo 'CORE = "'`md5 -q www_static/core.js`'"' >> version.py
|
||||
echo 'UI = "'`md5 -q www_static/frontend.html`'"' >> version.py
|
||||
echo 'MAP = "'`md5 -q www_static/partial-map.html`'"' >> version.py
|
||||
echo 'DEV = "'`md5 -q www_static/dev-tools.html`'"' >> version.py
|
||||
elif [ $(command -v md5sum) ]; then
|
||||
echo 'CORE = "'`md5sum www_static/core.js | cut -c-32`'"' >> version.py
|
||||
echo 'UI = "'`md5sum www_static/frontend.html | cut -c-32`'"' >> version.py
|
||||
echo 'MAP = "'`md5sum www_static/partial-map.html | cut -c-32`'"' >> version.py
|
||||
echo 'DEV = "'`md5sum www_static/dev-tools.html | cut -c-32`'"' >> version.py
|
||||
else
|
||||
echo 'Could not find an MD5 utility'
|
||||
fi
|
||||
cd ../../../..
|
||||
script/fingerprint_frontend.py
|
||||
|
||||
Reference in New Issue
Block a user