First pass for scripts to rule them all

This commit is contained in:
Paulus Schoutsen 2015-09-17 00:35:26 -07:00
parent 3947ed3c2b
commit 8c77418b6a
18 changed files with 52 additions and 44 deletions

20
script/build_frontend Executable file
View file

@ -0,0 +1,20 @@
# Builds the frontend for production
cd "$(dirname "$0")/.."
cd homeassistant/components/frontend/www_static/home-assistant-polymer
npm run frontend_prod
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
cp build/frontend.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 'VERSION = "'`md5 -q www_static/frontend.html`'"' >> version.py
elif [ $(command -v md5sum) ]; then
echo 'VERSION = "'`md5sum www_static/frontend.html | cut -c-32`'"' >> version.py
else
echo 'Could not find an MD5 utility'
fi