Does anyone know of a good way to automatically run certain file types through a processing script on upload? I’m trying to accomplish automatically minifying CSS and Javascript when I upload them to the server, keeping a nice, human-readable version on the local side while keeping a minified one on the server. I’m currently using WinSCP on Windows, which is scriptable to some degree but might not be scriptable enough. I’d probably need some kind of cobbled-together solution, so don’t be afraid to suggest something with duct tape in it; however, I do need to do the minification on my local computer and upload the squished file, since I use shared hosting and can’t install junk on the server.
Thanks.
I recommend creating a makefile to solve this particular problem, here’s a quick and dirty makefile I’m using for a site of mine:
Then all you have to type is:
First it takes all of your development files and concatenates them into a single file, then the concatenated file gets compressed and copied into your public directory. I’m using YUICompressor for compression, it works quite well.