Merge branch 'dev' of https://git.verdnatura.es/salix into dev

* 'dev' of https://git.verdnatura.es/salix:
  install packages on folders with file package.json - gulp install
This commit is contained in:
Carlos 2017-09-17 18:11:07 +02:00
commit 725815678d
2 changed files with 22 additions and 0 deletions

View File

@ -4,6 +4,8 @@ var wrap = require('gulp-wrap');
var concat = require('gulp-concat'); var concat = require('gulp-concat');
var merge = require('merge-stream'); var merge = require('merge-stream');
var extend = require('gulp-extend'); var extend = require('gulp-extend');
var install = require('gulp-install');
var print = require('gulp-print');
var del = require('del'); var del = require('del');
var fs = require('fs'); var fs = require('fs');
var webpack = require('webpack'); var webpack = require('webpack');
@ -159,6 +161,24 @@ gulp.task('routes', function() {
.pipe(gulp.dest(buildDir)); .pipe(gulp.dest(buildDir));
}); });
// install packages from package.json in folders.
gulp.task('install', () => {
const pathServices = './services/';
const fileJson = [];
const services = fs.readdirSync(pathServices);
services.push('..');
services.forEach((service) => {
fileJson.push(pathServices.concat(service, '/package.json'));
});
return gulp.src(fileJson)
.pipe(print((filepath) => {
return `Installing packages in ${filepath}`;
}))
.pipe(install({
npm: ['--no-package-lock']
}));
});
// Watch // Watch
gulp.task('watch', function() { gulp.task('watch', function() {

View File

@ -39,6 +39,8 @@
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-concat": "^2.6.0", "gulp-concat": "^2.6.0",
"gulp-extend": "^0.2.0", "gulp-extend": "^0.2.0",
"gulp-install": "^1.1.0",
"gulp-print": "^2.0.1",
"gulp-util": "^3.0.7", "gulp-util": "^3.0.7",
"gulp-wrap": "^0.13.0", "gulp-wrap": "^0.13.0",
"gulp-yaml": "^1.0.1", "gulp-yaml": "^1.0.1",