2014-09-10 23:45:27 -04:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
2014-09-10 23:55:09 -04:00
|
|
|
watch: {
|
|
|
|
scripts: {
|
|
|
|
files: ['/tmp/test/*'],
|
|
|
|
tasks: 'fixwhitespace',
|
|
|
|
options: {
|
|
|
|
spawn: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2014-09-10 23:45:27 -04:00
|
|
|
trimtrailingspaces: {
|
|
|
|
main: {
|
2014-09-11 00:25:39 -04:00
|
|
|
src: ['<%= cwd %>/**/*'],
|
2014-09-10 23:45:27 -04:00
|
|
|
options: {
|
|
|
|
filter: 'isFile',
|
|
|
|
encoding: 'utf8',
|
|
|
|
failIfTrimmed: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-trimtrailingspaces');
|
2014-09-10 23:55:09 -04:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
2014-09-10 23:45:27 -04:00
|
|
|
|
2014-09-11 00:25:39 -04:00
|
|
|
var cwd = grunt.option('cwd');
|
2014-09-10 23:45:27 -04:00
|
|
|
grunt.registerTask('default', []);
|
2014-09-11 00:25:39 -04:00
|
|
|
grunt.registerTask('fixwhitespace', function() {
|
|
|
|
grunt.config.set('cwd', cwd);
|
|
|
|
grunt.task.run('trimtrailingspaces');
|
|
|
|
});
|
2014-09-10 23:45:27 -04:00
|
|
|
};
|