Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: Running jsmin as a post-build event

I'm trying to add jsmin.exe as a post-build event to my VS 2010 project but I get "error code 9009" when I try to build my project.

I've tested at the command prompt and found that if I navigate to the folder, then run

jsmin < debug.js > min.js

Then it works fine.

However, if I run the command from C:\ and enter the full path, it returns

'C:\Users\Andrew\Documents\Visual' is not recognized as an internal or external command, operable program or batch file.

So my conclusion is that jsmin doesn't appear to like spaces in the file path. Given that Visual Studio's convention is to store the projects in a sub-folder of \Visual Studio 2010\, can anyone suggest how I can get around this issue?

like image 310
awj Avatar asked May 06 '11 20:05

awj


1 Answers

Sounds like you need to put double-quotes around the path.

e.g.:

jsmin <"$(ProjectDir)\debug.js" >"$(ProjectDir)\min.js"

like image 140
Tim Sylvester Avatar answered Sep 25 '22 15:09

Tim Sylvester