Gulp bugs

This commit is contained in:
Juan Ferrer Toribio 2018-02-07 13:24:46 +01:00
parent fda8750304
commit ca0731714a
1 changed files with 13 additions and 12 deletions

View File

@ -77,9 +77,17 @@ gulp.task('e2e-run', () => {
gulp.task('clean', () => { gulp.task('clean', () => {
const del = require('del'); const del = require('del');
return del([`${buildDir}/*`, `!${buildDir}/templates`, `!${buildDir}/images`], {force: true}); const files = [
`${buildDir}/*`,
`!${buildDir}/templates`,
`!${buildDir}/images`,
`docker-compose.yml`
];
return del(files, {force: true});
}); });
gulp.task('i', ['install']);
gulp.task('install', () => { gulp.task('install', () => {
const install = require('gulp-install'); const install = require('gulp-install');
let jsonFile = []; let jsonFile = [];
@ -97,9 +105,6 @@ gulp.task('install', () => {
})); }));
}); });
// Gulp install alias
gulp.task('i', ['install']);
// Deployment // Deployment
gulp.task('build', ['clean'], () => { gulp.task('build', ['clean'], () => {
@ -186,9 +191,8 @@ gulp.task('nginx-stop', ['nginx-conf'], async () => {
gulp.task('nginx-conf', async () => { gulp.task('nginx-conf', async () => {
const mustache = require('mustache'); const mustache = require('mustache');
if (!fs.existsSync(nginxTemp)) { if (!await fs.exists(nginxTemp))
fs.mkdirSync(nginxTemp); await fs.mkdir(nginxTemp);
}
let params = { let params = {
services: await getServices(), services: await getServices(),
@ -215,11 +219,8 @@ gulp.task('nginx-clean', () => {
return del([`${nginxTemp}/*`], {force: true}); return del([`${nginxTemp}/*`], {force: true});
}); });
let services;
async function getServices() { async function getServices() {
if (services) return services; let services;
let startPort = defaultPort + 1; let startPort = defaultPort + 1;
services = []; services = [];
@ -285,7 +286,7 @@ gulp.task('webpack-dev-server', function() {
// Locale // Locale
let localeFiles = `${srcDir}/**/locale/*.json`; let localeFiles = `${srcDir}/**/locale/*.yml`;
gulp.task('locales', function() { gulp.task('locales', function() {
const extend = require('gulp-extend'); const extend = require('gulp-extend');