1 /* jshint node: true */
4 var exec = require('child_process').exec;
5 var fs = require('fs');
7 exec('git diff --cached --name-status', function (err, stdout) {
10 stdout.split('\n').forEach(function(line) {
11 var filePath = line.split('\t')[1];
12 if(filePath && filePath.substr(-3) === '.js' && fs.existsSync(filePath)) {
13 toLint.push(filePath);
17 exec('grunt {{task}} {{args}} --jshint-targets=' + toLint.join(','), function (err, stdout) {
19 process.exit(err ? -1 : 0);