compile.sh 596 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. folderCSS="../assets/css"
  3. folderJS="../assets/js"
  4. if [ -e "$folderCSS/modules/" ]
  5. then
  6. echo "Compiling CSS ..."
  7. awk 'FNR==1{print ""}1' $folderCSS/modules/*.css > $folderCSS/min/main.css
  8. csso $folderCSS/min/main.css $folderCSS/min/main.css
  9. echo "CSS compiled!"
  10. else
  11. echo "CSS files not found in $folderCSS"
  12. fi
  13. if [ -e "$folderJS/modules/" ]
  14. then
  15. echo "Compiling JS ..."
  16. awk 'FNR==1{print ""}1' $folderJS/modules/*.js > $folderJS/min/main.js
  17. uglifyjs $folderJS/min/main.js -o $folderJS/min/main.js
  18. echo "JS compiled!"
  19. else
  20. echo "JS files not found in $folderJS"
  21. fi