2014-10-25 05:59:36 +00:00
|
|
|
# To build the frontend, you need node, bower and vulcanize
|
|
|
|
# npm install -g bower vulcanize
|
2014-11-12 08:36:20 +00:00
|
|
|
|
|
|
|
# Install dependencies
|
2014-10-22 07:18:00 +00:00
|
|
|
cd homeassistant/components/http/www_static/polymer
|
|
|
|
bower install
|
2014-10-27 01:10:01 +00:00
|
|
|
cd ..
|
2014-11-12 08:36:20 +00:00
|
|
|
cp polymer/bower_components/webcomponentsjs/webcomponents.min.js .
|
|
|
|
|
|
|
|
# Let Polymer refer to the minified JS version before we compile
|
|
|
|
sed -i.bak 's/polymer\.js/polymer\.min\.js/' polymer/bower_components/polymer/polymer.html
|
2014-11-14 06:47:06 +00:00
|
|
|
|
|
|
|
vulcanize -o frontend.html --inline --strip polymer/splash-login.html
|
2014-11-12 08:36:20 +00:00
|
|
|
|
|
|
|
# Revert back the change to the Polymer component
|
|
|
|
rm polymer/bower_components/polymer/polymer.html
|
|
|
|
mv polymer/bower_components/polymer/polymer.html.bak polymer/bower_components/polymer/polymer.html
|
|
|
|
|
|
|
|
# Generate the MD5 hash of the new frontend
|
2014-10-27 01:10:01 +00:00
|
|
|
cd ..
|
2014-11-03 01:57:48 +00:00
|
|
|
echo '""" DO NOT MODIFY. Auto-generated by build_frontend script """' > frontend.py
|
2014-10-27 01:10:01 +00:00
|
|
|
echo 'VERSION = "'`md5 -q www_static/frontend.html`'"' >> frontend.py
|