Skip to content

Commit

Permalink
Merge pull request #24 from Xevi/xevi/fix-grunt-task
Browse files Browse the repository at this point in the history
Fix the grunt task.
  • Loading branch information
cheton committed Mar 15, 2016
2 parents 2b1c5be + 51da9d6 commit 19cebd4
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions tasks/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
'use strict';

var i18next = require('..');
var through2 = require('through2');
var vfs = require('vinyl-fs');

var tap = function(callback) {
return through2.obj(function(file, enc, done) {
if (typeof callback === 'function') {
callback();
}
done();
});
};

module.exports = function(grunt) {
grunt.registerMultiTask('i18next', 'A grunt task for i18next-scanner', function() {
var done = this.async();
Expand All @@ -23,9 +13,9 @@ module.exports = function(grunt) {
vfs.src(target.files || target.src, {base: target.base || '.'})
.pipe(i18next(options, target.customTransform, target.customFlush))
.pipe(vfs.dest(target.dest || '.'))
.pipe(tap(function() {
.on('end', function() {
done();
}));
});
});
});
};

0 comments on commit 19cebd4

Please sign in to comment.