Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YUI Compressor on entire directory - os x

I am trying to figure out how to run yui compressor on an entire directory. I want to compress the directory to another directory named compressed.

Any advice?

like image 681
jhanifen Avatar asked Nov 15 '22 06:11

jhanifen


1 Answers

Assuming current working directory in a terminal contains these three:

  • css/
  • compressed/
  • yuicompressor-2.4.2.jar

Run this command:

for i in `ls css`; do java -jar yuicompressor-2.4.2.jar -o compressed/$i css/$i; done;

Note this does not work recursively.

like image 186
Rob Olmos Avatar answered Dec 31 '22 00:12

Rob Olmos