Browse Source

ci(scripts): fix gulp script

pull/2382/head
mehmet-erim 7 years ago
parent
commit
baf5d389d0
  1. 15
      npm/run-gulp-script.js

15
npm/run-gulp-script.js

@ -1,13 +1,14 @@
const glob = require('glob'); const glob = require('glob');
var path = require('path'); var path = require('path');
const childProcess = require('child_process'); const childProcess = require('child_process');
const execa = require('execa');
const gulp = pkgJsonPath => { const gulp = gulpfilePath => {
try { try {
console.log('Running the yarn command... Cwd: ' + pkgJsonPath); console.log('Running the yarn command... Cwd: ' + gulpfilePath);
childProcess.execSync(`yarn`, { cwd: pkgJsonPath }); execa.sync(`yarn`, ['install'], { cwd: gulpfilePath });
console.log('Running the gulp command...'); console.log('Running the gulp command...');
return childProcess.execSync(`gulp`, { cwd: pkgJsonPath, stdio: 'inherit' }); execa.sync(`yarn`, ['gulp'], { cwd: gulpfilePath, stdio: 'inherit' });
} catch (error) { } catch (error) {
console.log('exec error: ' + error.message); console.log('exec error: ' + error.message);
process.exit(error.status); process.exit(error.status);
@ -16,12 +17,12 @@ const gulp = pkgJsonPath => {
const folder = process.argv[2] || '.'; const folder = process.argv[2] || '.';
glob(folder + '/**/package.json', {}, (er, files) => { glob(folder + '/**/gulpfile.js', {}, (er, files) => {
files.forEach(file => { files.forEach(file => {
if (file.includes('node_modules')) { if (file.includes('node_modules') || file.includes('wwwroot')) {
return; return;
} }
gulp(file.replace('/package.json', '')); gulp(file.replace('/gulpfile.js', ''));
}); });
}); });

Loading…
Cancel
Save