Skip to content

Instantly share code, notes, and snippets.

@curiouslychase
Created November 19, 2013 14:07
Show Gist options
  • Save curiouslychase/7545897 to your computer and use it in GitHub Desktop.
Save curiouslychase/7545897 to your computer and use it in GitHub Desktop.
grunt.event.on('watch', function (action, path, target) {
if (target === 'html' || target === 'css' /* and on and on for your target types in watch */) {
grunt.config(['clean', 'any'], []);
// Making an assumption your using sftp and have a current working directory setup
cwd = grunt.config.get(['sftp', 'cwd']) + '/';
path = path.replace(cwd, '');
grunt.config(['sftp', 'options', 'path'], path);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment