build.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. mkdir build
  2. cp -r web/* build/
  3. echo "$1";
  4. if [ ! -z "$1" ]; then
  5. echo "asdas";
  6. sed -i "s|http://localhost:8080|$1|g" build/js/ip.js
  7. fi
  8. rm build/css/styles.css
  9. uglifycss --output build/css/styles.min.css web/css/styles.css
  10. sed -i 's|<link rel="stylesheet" type="text/css" href="css/styles.css">|<link rel="stylesheet" type="text/css" href="css/styles.min.css">|g' build/index.html
  11. sed -i 's|<link rel="stylesheet" type="text/css" href="css/styles.css">|<link rel="stylesheet" type="text/css" href="css/styles.min.css">|g' build/about.html
  12. rm build/js/jszip.min.js build/js/editor.js build/js/FileSaver.js
  13. cat web/js/jszip.min.js web/js/editor.js web/js/FileSaver.js build/js/ip.js | uglifyjs > build/js/index.min.js
  14. sed -i 's|<script src="js/editor.js"></script>|<script src="js/index.min.js"></script>|g' build/index.html
  15. sed -i 's|<script src="js/ip.js"></script>||g' build/index.html
  16. sed -i 's|<script src="js/jszip.min.js"></script>||g' build/index.html
  17. sed -i 's|<script src="js/FileSaver.js"></script>||g' build/index.html
  18. rm build/creta/src/js/creta-core.js build/creta/src/js/creta-ui.js build/creta/src/js/creta.js build/creta/src/js/beautify-html.js
  19. cat web/creta/src/js/creta-core.js web/creta/src/js/creta-ui.js web/creta/src/js/creta.js web/creta/src/js/beautify-html.js | uglifyjs > build/creta/src/js/creta.min.js
  20. sed -i 's|<script src="creta/src/js/creta-core.js"></script>|<script src="creta/src/js/creta.min.js"></script>|g' build/index.html
  21. sed -i 's|<script src="creta/src/js/creta-ui.js"></script>||g' build/index.html
  22. sed -i 's|<script src="creta/src/js/creta.js"></script>||g' build/index.html
  23. sed -i 's|<script src="creta/src/js/beautify-html.js"></script>||g' build/index.html
  24. rm build/js/tedi/html2tedi.js build/js/tedi/tedi2html.js build/js/tedi/tedi2lang.js build/js/tedi/tedi2tex.js build/js/tedi/tedi2md.js
  25. cat web/js/tedi/tedi2lang.js web/js/tedi/html2tedi.js web/js/tedi/tedi2html.js web/js/tedi/tedi2tex.js web/js/tedi/tedi2md.js | uglifyjs > build/js/tedi/tedi2langs.js
  26. sed -i 's|<script src="js/tedi/tedi2lang.js"></script>|<script src="js/tedi/tedi2langs.js"></script>|g' build/index.html
  27. sed -i 's|<script src="js/tedi/html2tedi.js"></script>||g' build/index.html
  28. sed -i 's|<script src="js/tedi/tedi2tex.js"></script>||g' build/index.html
  29. sed -i 's|<script src="js/tedi/tedi2html.js"></script>||g' build/index.html
  30. sed -i 's|<script src="js/tedi/tedi2md.js"></script>||g' build/index.html
  31. rm -r build/creta/src/icons/ build/creta/test/
  32. cp -r web/js/output build/js/
  33. cp web/js/mathjax.js build/js/mathjax.js