forked from mgcrea/angular-strap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreporter.js
More file actions
25 lines (22 loc) · 722 Bytes
/
reporter.js
File metadata and controls
25 lines (22 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
var util = require('util');
var gutil = require('gulp-util');
var through2 = require('through2');
var exec = require('child_process').exec;
var path = require('path');
module.exports = function() {
return through2.obj(function handleFile(file, encoding, next) {
var self = this;
exec(util.format('CODECLIMATE_REPO_TOKEN=%s %s < "%s"', process.env.CODE_CLIMATE_TOKEN, '$(npm bin)/codeclimate-test-reporter', file.path), function(err) {
if (err) {
next(new gutil.PluginError({
plugin: 'codeclimate-test-reporter',
message: err
}));
return;
}
gutil.log('Coverage file posted: "%s"', file.path);
self.emit('end');
});
});
};