Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

  1. #!/bin/bash
  2. command -v uglifyjs >/dev/null 2>&1 || { echo >&2 "I require UglifyJS but it's not installed. Aborting."; exit 1; }
  3. MINIFY_CMD=uglifyjs
  4. JSFILES=(
  5. "js/acl.js"
  6. "js/ajaxupload.js"
  7. "js/country.js"
  8. "js/jquery.htmlstream.js"
  9. "js/main.js"
  10. "js/webtoolkit.base64.js"
  11. "view/theme/frost/js/acl.js"
  12. "view/theme/frost/js/jquery.divgrow-1.3.1.f1.js"
  13. "view/theme/frost/js/main.js"
  14. "view/theme/frost/js/theme.js"
  15. "view/theme/frost-mobile/js/acl.js"
  16. "view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js"
  17. "view/theme/frost-mobile/js/main.js"
  18. "view/theme/frost-mobile/js/theme.js"
  19. "view/theme/decaf-mobile/js/theme.js"
  20. )
  21. JSFILES2=(
  22. "library/colorbox/jquery.colorbox.js"
  23. )
  24. for i in ${JSFILES[@]}
  25. do
  26. MINFILE=${i%%.js}.min.js
  27. echo "Minifying $i into $MINFILE"
  28. rm $MINFILE
  29. $MINIFY_CMD -o $MINFILE $i
  30. done
  31. for i in ${JSFILES2[@]}
  32. do
  33. MINFILE=${i%%.js}-min.js
  34. echo "Minifying $i into $MINFILE"
  35. rm $MINFILE
  36. $MINIFY_CMD -o $MINFILE $i
  37. done
  38. for i in ${JSFILES3[@]}
  39. do
  40. MINFILE=${i%%_src.js}.js
  41. echo "Minifying $i into $MINFILE"
  42. rm $MINFILE
  43. $MINIFY_CMD -o $MINFILE $i
  44. done