Skip to content

Commit bac6d13

Browse files
committed
chore(gulp): working code-climate reporter
1 parent d08ffb3 commit bac6d13

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tasks/helpers/reporter.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ var through2 = require('through2');
66
var exec = require('child_process').exec;
77
var path = require('path');
88

9-
module.exports = function ccm() {
9+
module.exports = function() {
1010

11-
var ccReporter = path.join(__dirname, 'node_modules', '.bin', 'codeclimate-test-reporter');
1211
return through2.obj(function handleFile(file, encoding, next) {
13-
exec(util.format('CODECLIMATE_REPO_TOKEN=%s %s < "%s"', process.env.CODE_CLIMATE_TOKEN, ccReporter, file.path), function(err) {
12+
var self = this;
13+
exec(util.format('CODECLIMATE_REPO_TOKEN=%s %s < "%s"', process.env.CODE_CLIMATE_TOKEN, '$(npm bin)/codeclimate-test-reporter', file.path), function(err) {
1414
if (err) {
1515
next(new gutil.PluginError({
16+
plugin: 'codeclimate-test-reporter',
1617
message: err
1718
}));
1819
return;
1920
}
2021
gutil.log('Coverage file posted: "%s"', file.path);
21-
next();
22+
self.emit('end');
2223
});
2324
});
2425
};

0 commit comments

Comments
 (0)