Browse Source

use fast-glob instead of regular glob package

pull/10098/head
Mehmet Erim 4 years ago
parent
commit
5d6b99c529
  1. 1
      npm/package.json
  2. 14
      npm/update-gulp.js
  3. 2
      npm/yarn.lock

1
npm/package.json

@ -16,6 +16,7 @@
"dependencies": {
"commander": "^6.0.0",
"execa": "^3.4.0",
"fast-glob": "^3.2.7",
"fs-extra": "^8.1.0",
"semver": "^7.3.5"
}

14
npm/update-gulp.js

@ -1,4 +1,4 @@
const glob = require('glob');
const glob = require('fast-glob');
var path = require('path');
const childProcess = require('child_process');
const execa = require('execa');
@ -18,6 +18,7 @@ const gulp = (folderPath) => {
}
try {
fse.removeSync(`${folderPath}/wwwroot/libs`);
execa.sync('yarn', ['install'], { cwd: folderPath, stdio: 'inherit' });
execa.sync('yarn', ['gulp'], { cwd: folderPath, stdio: 'inherit' });
} catch (error) {
@ -40,8 +41,9 @@ const updatePackages = (pkgJsonPath) => {
}
};
console.time();
glob('../**/package.json', {}, (er, files) => {
(async () => {
console.time();
let files = await glob('../**/package.json');
files = files.filter(
(f) =>
f &&
@ -53,7 +55,9 @@ glob('../**/package.json', {}, (er, files) => {
files.forEach((file) => {
updatePackages(file);
gulp(file.replace('package.json', ''));
const folderPath = file.replace('package.json', '');
gulp(folderPath);
});
console.timeEnd();
});
})();

2
npm/yarn.lock

@ -2266,7 +2266,7 @@ fast-glob@^2.2.6:
merge2 "^1.2.3"
micromatch "^3.1.10"
fast-glob@^3.1.1:
fast-glob@^3.1.1, fast-glob@^3.2.7:
version "3.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==

Loading…
Cancel
Save