hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit 80b01b6885edffff9291ba5bf981ec986488c00b
parent 7122c725f7842690e4e21569d92c8f0e95d18d59
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sun, 11 Dec 2016 11:42:02 -0500

Check if the Minify CLI is there

Diffstat:
Mfrontend | 41+++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/frontend b/frontend @@ -1,21 +1,30 @@ #!/bin/bash -# CSS Concatenation -cat static/dev/css/global/fonts.css \ - static/dev/css/global/normalize.css \ - static/dev/css/global/base.css \ - static/dev/css/global/helpers.css \ - static/dev/css/global/grid.css \ - static/dev/css/modules/*.css \ - > static/prod/css/styles.css && +# You must install "Minify CLI" for running this script : +# <https://github.com/tdewolff/minify/tree/master/cmd/minify> - # CSS Minification - minify --mime=text/css < static/prod/css/styles.css > static/prod/css/styles.min.css +if hash minify 2>/dev/null; then + # CSS Concatenation + cat static/dev/css/global/fonts.css \ + static/dev/css/global/normalize.css \ + static/dev/css/global/base.css \ + static/dev/css/global/helpers.css \ + static/dev/css/global/grid.css \ + static/dev/css/modules/*.css \ + > static/prod/css/styles.css && -# JavaScript Concatenation -cat static/dev/js/vendor/dom-utilities/dom-utilities.js \ - static/dev/js/custom/init.js \ - > static/prod/js/script.js + # CSS Minification + minify -v --mime=text/css < static/prod/css/styles.css > static/prod/css/styles.min.css -# JavaScript Minification -minify --mime=text/javascript < static/prod/js/script.js > static/prod/js/script.min.js + # JavaScript Concatenation + cat static/dev/js/vendor/dom-utilities/dom-utilities.js \ + static/dev/js/custom/init.js \ + > static/prod/js/script.js && + + # JavaScript Minification + minify -v --mime=text/javascript < static/prod/js/script.js > static/prod/js/script.min.js + +else + echo "- You must install Minify CLI for running this script" + echo "- <https://github.com/tdewolff/minify/tree/master/cmd/minify>" +fi