Posted By

rhysburnie on 11/11/11


Tagged

javascript Bash


Versions (?)

A default build script for Interleave js packager


 / Published in: Bash
 

Temporary js compile workflow until the Interleave developer implements "watch" functionality

  1. #!
  2. read -p "Compress output? y/n: " yn
  3.  
  4. PATH_YUI=/Volumes/woot/yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar
  5.  
  6. PATH_IN=./src/js/
  7. PATH_OUT=./www/assets/js/
  8.  
  9. for file in before.js after.js
  10. do
  11. if [ -f $PATH_IN$file ]
  12. then
  13. interleave -o $file -p $PATH_OUT $PATH_IN$file
  14. #Compress
  15. if [ "$yn" == "y" -a -f $PATH_YUI ]
  16. then
  17. java -jar $PATH_YUI $PATH_OUT$file -o $PATH_OUT$file
  18. else
  19. echo "$file not compressed"
  20. fi
  21. else
  22. echo "$PATH_IN$file doesn't exist!"
  23. fi
  24. done
  25.  
  26. if [ ! -f $PATH_YUI ]
  27. then
  28. echo "YUI Compressor not found"
  29. fi

Report this snippet  

You need to login to post a comment.