Skip to content

Commit

Permalink
fix: use fast-glob instead of glob
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-C committed Jan 3, 2025
1 parent 05b33be commit 9317689
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/ndla-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dependencies": {
"cross-spawn": "^7.0.3",
"cross-spawn-promise": "^0.10.2",
"fast-glob": "^3.3.2",
"normalize-url": "^8.0.1",
"url-regex-safe": "^4.0.0",
"vercel": "^33.6.2"
Expand Down
5 changes: 2 additions & 3 deletions packages/ndla-scripts/src/run-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

import { join, dirname } from "path";
import spawn from "cross-spawn";
import { glob } from "glob";
import fastGlob from "fast-glob";

const { sync } = glob;
const __dirname = dirname(new URL(import.meta.url).pathname);

const [executor, ignoredBin, script, ...args] = process.argv;
Expand Down Expand Up @@ -57,7 +56,7 @@ if (script) {
spawnScript();
} else {
const scriptsPath = join(__dirname, "scripts/");
const scriptsAvailable = sync(join(__dirname, "scripts", "*"));
const scriptsAvailable = fastGlob.sync(join(__dirname, "scripts", "*"));
const scriptsAvailableMessage = scriptsAvailable
.map((s) => s.replace(scriptsPath, "").replace(/\.js$/, ""))
.filter(Boolean)
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,7 @@ __metadata:
dependencies:
cross-spawn: "npm:^7.0.3"
cross-spawn-promise: "npm:^0.10.2"
fast-glob: "npm:^3.3.2"
normalize-url: "npm:^8.0.1"
url-regex-safe: "npm:^4.0.0"
vercel: "npm:^33.6.2"
Expand Down

0 comments on commit 9317689

Please sign in to comment.