Apply fixwhitespace task to the current directory
This commit is contained in:
parent
298086a3b7
commit
614edcc8ba
2 changed files with 13 additions and 5 deletions
|
@ -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');
|
||||
});
|
||||
};
|
||||
|
|
10
README.md
10
README.md
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue