Skip to content

Instantly share code, notes, and snippets.

@mach3
Created Oct 28, 2010
Embed
What would you like to do?
Windows Batch File to use YUI Compressor easily
@echo off
if "%1" == "" goto error
setlocal
set jarfile="C:\Program Files\yuicompressor-2.4.2\build\yuicompressor-2.4.2.jar"
set infile=%1
set ext=%~x1
if %ext% == .css set outfile=%infile:.css=.min.css%
if %ext% == .js set outfile=%infile:.js=.min.js%
java -jar %jarfile% -v --charset UTF-8 -o %outfile% %infile%
endlocal
goto end
:error
echo No Argument
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment