Skip to content

Commit

Permalink
chore(dev-scripts): rework options passed to glob (#12829)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas committed May 10, 2022
1 parent 8e8ee90 commit d0cfb8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 1 addition & 3 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ function getBuildPath(file, buildFolder) {

function buildNodePackage({packageDir, pkg}) {
const srcDir = path.resolve(packageDir, SRC_DIR);
const files = glob
.sync('**/*', {cwd: srcDir, nodir: true})
.map(res => path.join(srcDir, res));
const files = glob.sync('**/*', {absolute: true, cwd: srcDir, nodir: true});

process.stdout.write(adjustToTerminalWidth(`${pkg.name}\n`));

Expand Down
15 changes: 6 additions & 9 deletions scripts/cleanE2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {dirname, join, normalize, resolve} from 'path';
import {dirname, normalize, resolve} from 'path';
import {fileURLToPath} from 'url';
import glob from 'glob';
import rimraf from 'rimraf';
Expand All @@ -23,14 +23,11 @@ const excludedModules = [

const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..');

const e2eNodeModules = [
...glob.sync('e2e/*/node_modules/', {cwd: rootDir}),
...glob.sync('e2e/*/*/node_modules/', {cwd: rootDir}),
]
.map(res => join(rootDir, res))
.filter(dir => !excludedModules.includes(dir))
.map(dir => resolve(rootDir, dir))
.sort();
const e2eNodeModules = glob.sync('e2e/{*,*/*}/node_modules/', {
absolute: true,
cwd: rootDir,
ignore: excludedModules,
});

e2eNodeModules.forEach(dir => {
rimraf.sync(dir, {glob: false});
Expand Down

0 comments on commit d0cfb8f

Please sign in to comment.