Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Dec 10, 2015
2 parents cb221d9 + 7187c5b commit 80d74d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "i18next-scanner",
"version": "0.5.7",
"version": "0.5.8",
"description": "i18next-scanner is a transfrom stream that can scan your code, extract translation keys/values, and merge them into i18n resource files.",
"homepage": "https://github.com/i18next/i18next-scanner",
"author": "Cheton Wu <cheton@gmail.com>",
Expand Down Expand Up @@ -35,7 +35,7 @@
"lodash": "^3.10.1",
"through2": "^2.0.0",
"vinyl": "^1.1.0",
"vinyl-fs": "^0.3.14"
"vinyl-fs": "^2.2.1"
},
"devDependencies": {
"coveralls": "^2.11.4",
Expand Down
20 changes: 15 additions & 5 deletions tasks/index.js
@@ -1,9 +1,19 @@
'use strict';

module.exports = function(grunt) {
var i18next = require('..');
var vfs = require('vinyl-fs');
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();
var options = this.options() || {};
Expand All @@ -13,9 +23,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 || '.'))
.on('end', function() {
.pipe(tap(function() {
done();
});
}));
});
});
};

0 comments on commit 80d74d3

Please sign in to comment.