Remove unused promises, opted for forEach iteration

This commit is contained in:
Sean Newell 2017-03-10 09:00:04 -06:00
parent 86d569e636
commit 199b571d07

View File

@ -193,8 +193,7 @@ gulp.task('chat-styles-handlebars', function() {
list.filter(function(path) {
return fs.lstatSync(config.chatStylesPath + "/" + path).isDirectory();
}).map(function(dir) {
return new Promise(function(resolve, reject) {
}).forEach(function(dir) {
gulp.src(config.chatStylesPath + '/' + dir + '/templates_src/client_side/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
@ -204,10 +203,7 @@ gulp.task('chat-styles-handlebars', function() {
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/templates_compiled/client_side'))
.on('end', resolve)
.on('error', reject);
});
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/templates_compiled/client_side'));
});
});
});
@ -221,15 +217,11 @@ gulp.task('chat-styles-js', function() {
list.filter(function(path) {
return fs.lstatSync(config.chatStylesPath + "/" + path).isDirectory();
}).map(function(dir) {
return new Promise(function(resolve, reject) {
}).forEach(function(dir) {
gulp.src(config.chatStylesPath + '/' + dir + '/js/source/**/*.js')
.pipe(concat('scripts.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/js/compiled'))
.on('end', resolve)
.on('error', reject);
});
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/js/compiled'));
});
});
});
@ -243,8 +235,7 @@ gulp.task('page-styles', function() {
list.filter(function(path) {
return fs.lstatSync(config.pageStylesPath + "/" + path).isDirectory();
}).map(function(dir) {
return new Promise(function(resolve, reject) {
}).forEach(function(dir) {
gulp.src(config.pageStylesPath + '/' + dir + '/templates_src/client_side/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
@ -254,10 +245,7 @@ gulp.task('page-styles', function() {
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(config.pageStylesPath + '/' + dir + '/templates_compiled/client_side'))
.on('end', resolve)
.on('error', reject);
});
.pipe(gulp.dest(config.pageStylesPath + '/' + dir + '/templates_compiled/client_side'));
});
});
});