1
0
Fork 0

Apply fixwhitespace task to the current directory

This commit is contained in:
Andrew Tomaka 2014-09-11 00:25:39 -04:00
parent 298086a3b7
commit 614edcc8ba
2 changed files with 13 additions and 5 deletions

View File

@ -12,7 +12,7 @@ module.exports = function(grunt) {
},
trimtrailingspaces: {
main: {
src: ['/tmp/test/*'],
src: ['<%= cwd %>/**/*'],
options: {
filter: 'isFile',
encoding: 'utf8',
@ -25,6 +25,10 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-trimtrailingspaces');
grunt.loadNpmTasks('grunt-contrib-watch');
var cwd = grunt.option('cwd');
grunt.registerTask('default', []);
grunt.registerTask('fixwhitespace', ['trimtrailingspaces']);
grunt.registerTask('fixwhitespace', function() {
grunt.config.set('cwd', cwd);
grunt.task.run('trimtrailingspaces');
});
};

View File

@ -1,10 +1,14 @@
# Global Runners
## Setup
Add an alias to your rc file
```alias rt="grunt --gruntfile ~/grunt-test/Gruntfile.js -cwd=`pwd`"```
## Usage
grunt --gruntfile ~/grunt-test/Gruntfile.js TASK
alias rt="grunt --gruntfile ~/grunt-test/Gruntfile.js TASK"
```rt TASK_NAME```
## Tasks