2016-10-25 14:09:53 +13:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2017-01-12 20:19:41 +13:00
|
|
|
# copy assets
|
2017-01-13 08:23:07 +13:00
|
|
|
echo -e Copying assets $SERVER
|
|
|
|
|
rsync -avrs src/assets/ mopidy_iris/static/assets/ 2>&1 >/dev/null
|
2017-01-12 20:19:41 +13:00
|
|
|
|
|
|
|
|
# create HTML files
|
2017-01-13 08:23:07 +13:00
|
|
|
echo -e Copying index.html and test.html
|
2017-01-12 20:19:41 +13:00
|
|
|
cp src/index.html mopidy_iris/static/index.html
|
|
|
|
|
cp src/index.html mopidy_iris/static/test.html
|
|
|
|
|
|
|
|
|
|
# process production html
|
2017-01-13 08:23:07 +13:00
|
|
|
CACHEBUSTER=$(date | md5sum | cut -f1 -d' ')
|
|
|
|
|
echo -e Cachebusting js/css URLs $CACHEBUSTER
|
2017-04-11 20:01:03 +12:00
|
|
|
sed -i 's/app.js/app.min.js?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/index.html
|
|
|
|
|
sed -i 's/app.css/app.min.css?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/index.html
|
|
|
|
|
sed -i 's/app.js/app.js?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/test.html
|
|
|
|
|
sed -i 's/app.css/app.css?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/test.html
|
2017-02-10 08:12:46 +13:00
|
|
|
sed -i 's/<\/head>/\t<script type="text\/javascript">window._testMode = true;<\/script>\n\n<\/head>/g' mopidy_iris/static/test.html
|
2017-01-13 08:23:07 +13:00
|
|
|
|
|
|
|
|
echo -e "\x1b[32;01m"Done!"\x1b[39;49;00m"
|