Another alternative to grunt is to use http://gulpjs.com/. This is what I use for minifying css js and assets etc. I've been meaning to setup a way of syncing folders so I've put together gulp task to do it. I have roughly tested it but you might want to look over the code before you use it on a production site :) Be aware that it is setup to sync the folder so it will remove any local files that are not present on your staging/production server.
To use gulp you need to have node.js installed with npm. First install gulp globally:
npm install -g gulp
you might need to run that as sudo.
Next, in the root of your craft project create a gulpfile.js that looks something like this:
// Gulp
var gulp = require('gulp');
// Plugins
var rsync = require("rsyncwrapper").rsync;
// Pull down assets and sync local folder
gulp.task('synclocal', function(){
rsync({
src: "[email protected]:/path/to/assets",
dest: "assets",
ssh: true,
recursive: true,
syncDest: true,
compareMode: "checksum"
},function (error,stdout,stderr,cmd) {
if ( error ) {
// failed
console.log(error.message);
} else {
// success
console.log("folder synced!")
}
});
});
Finally we need to make sure rsyncwrapper is install. You can do this by running:
npm install rsyncwrapper
You should now be able to run the task by typing:
gulp synclocal