Setup task to monitor for changes
This commit is contained in:
parent
cadce10c60
commit
298086a3b7
3 changed files with 17 additions and 0 deletions
10
Gruntfile.js
10
Gruntfile.js
|
@ -1,6 +1,15 @@
|
|||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
watch: {
|
||||
scripts: {
|
||||
files: ['/tmp/test/*'],
|
||||
tasks: 'fixwhitespace',
|
||||
options: {
|
||||
spawn: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
trimtrailingspaces: {
|
||||
main: {
|
||||
src: ['/tmp/test/*'],
|
||||
|
@ -14,6 +23,7 @@ module.exports = function(grunt) {
|
|||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-trimtrailingspaces');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
|
||||
grunt.registerTask('default', []);
|
||||
grunt.registerTask('fixwhitespace', ['trimtrailingspaces']);
|
||||
|
|
|
@ -5,3 +5,9 @@
|
|||
grunt --gruntfile ~/grunt-test/Gruntfile.js TASK
|
||||
|
||||
alias rt="grunt --gruntfile ~/grunt-test/Gruntfile.js TASK"
|
||||
|
||||
## Tasks
|
||||
|
||||
* fixwhitespace - Removes trailing whitespace from files in /tmp/test
|
||||
* watch - Watches /tmp/test for any changes and will run fixwhitespace if any
|
||||
occur
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-trimtrailingspaces": "^0.4.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue