Skip to content

Commit

Permalink
feat: minify html in mkrelease.sh
Browse files Browse the repository at this point in the history
fix: use minified files for sw.js
  • Loading branch information
jcorporation committed Jul 16, 2018
1 parent a46a9ac commit a84d83b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ target_link_libraries(mympd ${LIBMPDCLIENT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${

install(TARGETS mympd DESTINATION bin)
install(FILES contrib/mympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
install(FILES htdocs/mympd.webmanifest DESTINATION share/${PROJECT_NAME}/htdocs/)
install(FILES htdocs/index.html DESTINATION share/${PROJECT_NAME}/htdocs/)
install(FILES htdocs/player.html DESTINATION share/${PROJECT_NAME}/htdocs/)
install(FILES htdocs/sw.min.js DESTINATION share/${PROJECT_NAME}/htdocs/)
Expand Down
4 changes: 2 additions & 2 deletions htdocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ <h4><a class="text-success" rel="noreferrer" href="https://github.com/jcorporati
<p>myMPD is a lightweight MPD web client that runs without a dedicated webserver or interpreter. It's tuned for minimal resource usage and requires only very litte dependencies. myMPD is a fork of <a class="text-success" href="http://www.ympd.org">ympd</a>.</p>
<ul>
<li>Version: <span id="mympdVersion"></span></li>
<li>Homepage: <a class="text-success" target="_blank" href="https://github.com/jcorporation/mympd">https://github.com/jcorporation/mympd</a></li>
<li>Homepage: <a class="text-success" target="_blank" rel="noreferrer" href="https://github.com/jcorporation/mympd">https://github.com/jcorporation/mympd</a></li>
<li>Autor: Jürgen Mang &lt;<a class="text-success" href="mailto:[email protected]">[email protected]</a>&gt;</li>
</ul>
<table class="table table-sm">
Expand Down Expand Up @@ -667,7 +667,7 @@ <h5 class="modal-title" id="savequeueLabel"><span class="material-icons title-ic
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="savequeueLabel"><span class="material-icons title-icon">music_note</span> Song Details</h5>
<h5 class="modal-title"><span class="material-icons title-icon">music_note</span> Song Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
Expand Down
4 changes: 4 additions & 0 deletions mkrelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ echo "Replacing javascript and stylesheets with minified files"
sudo sed -i -e 's/mpd\.css/mpd\.min\.css/' -e 's/mpd\.js/mpd\.min\.js/' /usr/share/mympd/htdocs/index.html
sudo sed -i -e 's/mpd\.css/mpd\.min\.css/' -e 's/player\.js/player\.min\.js/' /usr/share/mympd/htdocs/player.html
sudo sed -i -e 's/mpd\.css/mpd\.min\.css/' -e 's/mpd\.js/mpd\.min\.js/' -e 's/player\.js/player\.min\.js/' /usr/share/mympd/htdocs/sw.min.js
sudo sed -i -e 's/\/sw\.js/\/sw\.min\.js/' /usr/share/mympd/htdocs/js/mpd.min.js
echo "Minifying html"
perl -i -pe 's/^\s*//gm; s/\s*$//gm' /usr/share/mympd/htdocs/index.html
perl -i -pe 's/^\s*//gm; s/\s*$//gm' /usr/share/mympd/htdocs/player.html

echo "Fixing ownership of /var/lib/mympd"
sudo chown nobody /var/lib/mympd
Expand Down

0 comments on commit a84d83b

Please sign in to comment.