Skip to content

Commit

Permalink
fix: properly install and use glob
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 22, 2022
1 parent 124406e commit 9bf3126
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/util/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const glob = promisify(require('glob'))
const Parser = require('./parser.js')
const template = require('./template.js')

const globify = pattern => pattern.split('\\').join('/')

// target paths need to be joinsed with dir and templated
const fullTarget = (dir, file, options) => join(dir, template(file, options))

Expand Down Expand Up @@ -33,7 +35,7 @@ const getParsers = (dir, files, options) => Object.entries(files).map(([t, s]) =
const rmEach = async (dir, files, options, fn) => {
const res = []
for (const target of files.map((t) => fullTarget(dir, t, options))) {
for (const file of await glob(target, { cwd: dir })) {
for (const file of await glob(globify(target), { cwd: dir })) {
res.push(await fn(file))
}
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@npmcli/map-workspaces": "^2.0.2",
"@npmcli/package-json": "^2.0.0",
"diff": "^5.0.0",
"glob": "^8.0.1",
"handlebars": "^4.7.7",
"hosted-git-info": "^5.0.0",
"json-parse-even-better-errors": "^2.3.1",
Expand Down

0 comments on commit 9bf3126

Please sign in to comment.