1
0
mirror of https://github.com/elisspace/core.git synced 2026-08-31 08:32:13 +00:00
Files
core/script/build_frontend
Paulus Schoutsen 2036c44364 Hotfix 21 2 (#2302)
* Update frontend

Conflicts:
	homeassistant/components/frontend/version.py
	homeassistant/components/frontend/www_static/core.js.gz
	homeassistant/components/frontend/www_static/frontend.html
	homeassistant/components/frontend/www_static/frontend.html.gz
	homeassistant/components/frontend/www_static/home-assistant-polymer
	homeassistant/components/frontend/www_static/service_worker.js
	homeassistant/components/frontend/www_static/service_worker.js.gz

* Add a default OPTIONS handler for wsgi (#2301)

When a browser makes a CORS request, it often makes a 'preflight'
options request in order to make sure the resource is valid, and that
it has the right CORS access. This adds a default OPTIONS handler for
all views. If a view needs to customize the OPTIONS handler for some
reason, it's free to, but this way CORS will work.

* Version bump to 0.21.2
2016-06-14 19:54:09 -07:00

32 lines
1.1 KiB
Plaintext
Executable File

# Builds the frontend for production
cd "$(dirname "$0")/.."
cd homeassistant/components/frontend/www_static/home-assistant-polymer/home-assistant-js/
npm run prod
cd ..
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/_core_compiled.js ../core.js
gzip build/_core_compiled.js -c -k -9 > ../core.js.gz
node script/sw-precache.js
cp build/service_worker.js ..
gzip build/service_worker.js -c -k -9 > ../service_worker.js.gz
# 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
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
else
echo 'Could not find an MD5 utility'
fi