2015-02-23 01:33:01 +00:00
|
|
|
# Builds the frontend for production
|
2015-02-09 07:33:19 +00:00
|
|
|
|
2015-01-17 22:32:33 +00:00
|
|
|
# If current pwd is scripts, go 1 up.
|
|
|
|
if [ ${PWD##*/} == "scripts" ]; then
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2015-07-13 03:43:07 +00:00
|
|
|
cd homeassistant/components/frontend/www_static/home-assistant-polymer
|
|
|
|
npm install
|
|
|
|
npm run frontend_prod
|
2015-02-06 06:36:23 +00:00
|
|
|
|
2015-07-13 03:43:07 +00:00
|
|
|
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
|
|
|
|
cp build/frontend.html ..
|
2014-11-12 08:36:20 +00:00
|
|
|
|
|
|
|
# Generate the MD5 hash of the new frontend
|
2015-07-13 03:43:07 +00:00
|
|
|
cd ../..
|
2015-01-30 16:26:06 +00:00
|
|
|
echo '""" DO NOT MODIFY. Auto-generated by build_frontend script """' > version.py
|
2015-01-22 05:22:40 +00:00
|
|
|
if [ $(command -v md5) ]; then
|
2015-01-30 16:26:06 +00:00
|
|
|
echo 'VERSION = "'`md5 -q www_static/frontend.html`'"' >> version.py
|
2015-01-22 05:22:40 +00:00
|
|
|
elif [ $(command -v md5sum) ]; then
|
2015-01-30 16:26:06 +00:00
|
|
|
echo 'VERSION = "'`md5sum www_static/frontend.html | cut -c-32`'"' >> version.py
|
2015-01-22 05:22:40 +00:00
|
|
|
else
|
2015-04-15 03:55:08 +00:00
|
|
|
echo 'Could not find an MD5 utility'
|
2015-01-22 05:22:40 +00:00
|
|
|
fi
|