javascript - Script/App that automatically compiles and compresses js files as you save -


I am creating a web site and keeping more than one JS files in a directory. When I save any of the JS files, I would like to run a script that will compile and compress all the files, Google Off Compiler Jar.

Example from Google Closure Compiler README:

java -jar compiler.jar --js = in1.js --js = in2.js ... --js_output_file = Out.js

Is there a shell script or does this app? How I work for CSS, I'm looking at anything like this.

In Linux you command to listen for changes in specific folders "inotifywait "This script can give you an idea:

  #! / Bin / bash directory = $ 1 inotifywait -q -m --format '% f' -e Modify -E Create Step-E-e $ {Directory}. While reading the line "do some: echo the line: $ line"; #for example: # java -jar compiler.jar --js = in1.js --js = in2.js ... --js_output_file = out.js done  

you They can use the "Monitor" directory in this script, thus

  ./inotify.sh ~ / Desktop /  
< / Html>

Comments