Skip to content

Instantly share code, notes, and snippets.

@cristiangrojas
Created September 11, 2013 20:40
Show Gist options
  • Save cristiangrojas/6529477 to your computer and use it in GitHub Desktop.
Save cristiangrojas/6529477 to your computer and use it in GitHub Desktop.
grunt restart watch
Meanwhile, a workaround is to restart watch when Gruntfile.js is modified. Here is a quick hack to do it.
Set the "nospawn" option of watch to true.
Add the following task in your Gruntfile.js:
grunt.registerTask('exit', 'Just exits.', function() {
process.exit(0);
});
Put this as a target of your watch:
watch: {
config: {
files: ['package.json', 'gruntfile.js'],
tasks: ['exit']
}
}
And finally you run this in your terminal:
while true; do grunt watch; echo -e "\nRESTART"; done
Note: you will need to close your terminal to stop watch. (Or do a ctrl-z followed by kill %1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment