From 32521c22b7362936ce2b245c58a6be4beaaa389a Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 11 Sep 2014 01:03:19 -0400 Subject: [PATCH] Move task to individual file --- Gruntfile.js | 6 +----- tasks/fixwhitespace.js | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 tasks/fixwhitespace.js diff --git a/Gruntfile.js b/Gruntfile.js index 5a707ff..58b8d9d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,10 +25,6 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-trimtrailingspaces'); grunt.loadNpmTasks('grunt-contrib-watch'); - var cwd = grunt.option('cwd'); grunt.registerTask('default', []); - grunt.registerTask('fixwhitespace', function() { - grunt.config.set('cwd', cwd); - grunt.task.run('trimtrailingspaces'); - }); + grunt.loadTasks('tasks'); }; diff --git a/tasks/fixwhitespace.js b/tasks/fixwhitespace.js new file mode 100644 index 0000000..bc4bf5a --- /dev/null +++ b/tasks/fixwhitespace.js @@ -0,0 +1,7 @@ +module.exports = function(grunt) { + grunt.registerTask('fixwhitespace', function() { + var cwd = grunt.option('cwd'); + grunt.config.set('cwd', cwd); + grunt.task.run('trimtrailingspaces'); + }); +};