Merge pull request #7241 from yurydelendik/server-importl10n-async
Makes importl10n and server async gulp functions.
This commit is contained in:
commit
ff6669d930
5
external/importL10n/locales.js
vendored
5
external/importL10n/locales.js
vendored
@ -82,10 +82,13 @@ function downloadLanguageFiles(root, langCode, callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadL10n(root) {
|
function downloadL10n(root, callback) {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
(function next() {
|
(function next() {
|
||||||
if (i >= langCodes.length) {
|
if (i >= langCodes.length) {
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
downloadLanguageFiles(root, langCodes[i++], next);
|
downloadLanguageFiles(root, langCodes[i++], next);
|
||||||
|
@ -51,7 +51,7 @@ gulp.task('default', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('server', function () {
|
gulp.task('server', function (done) {
|
||||||
console.log();
|
console.log();
|
||||||
console.log('### Starting local server');
|
console.log('### Starting local server');
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ gulp.task('makefile', function () {
|
|||||||
.pipe(gulp.dest('.'));
|
.pipe(gulp.dest('.'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('importl10n', function() {
|
gulp.task('importl10n', function(done) {
|
||||||
var locales = require('./external/importL10n/locales.js');
|
var locales = require('./external/importL10n/locales.js');
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
@ -89,7 +89,7 @@ gulp.task('importl10n', function() {
|
|||||||
if (!fs.existsSync(L10N_DIR)) {
|
if (!fs.existsSync(L10N_DIR)) {
|
||||||
fs.mkdirSync(L10N_DIR);
|
fs.mkdirSync(L10N_DIR);
|
||||||
}
|
}
|
||||||
locales.downloadL10n(L10N_DIR);
|
locales.downloadL10n(L10N_DIR, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Getting all shelljs registered tasks and register them with gulp
|
// Getting all shelljs registered tasks and register them with gulp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user