Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Apr 6, 2022
1 parent 7eaf32f commit 405301c
Show file tree
Hide file tree
Showing 23 changed files with 2,177 additions and 3,191 deletions.
6 changes: 5 additions & 1 deletion lib/workspaces/get-workspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const mapWorkspaces = require('@npmcli/map-workspaces')
const minimatch = require('minimatch')
const rpj = require('read-package-json-fast')

// minimatch wants forward slashes only for glob patterns
const globify = pattern => pattern.replace('\\', '/')

// Returns an Map of paths to workspaces indexed by workspace name
// { foo => '/path/to/foo' }
const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom }) => {
Expand All @@ -22,7 +25,8 @@ const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom
for (const [workspaceName, workspacePath] of workspaces.entries()) {
if (filterArg === workspaceName
|| resolve(relativeFrom || path, filterArg) === workspacePath
|| minimatch(workspacePath, `${resolve(relativeFrom || path, filterArg)}/*`)) {
|| minimatch(workspacePath, `${globify(resolve(relativeFrom || path, filterArg))}/*`)
) {
res.set(workspaceName, workspacePath)
}
}
Expand Down
15 changes: 0 additions & 15 deletions node_modules/@npmcli/map-workspaces/node_modules/minimatch/LICENSE

This file was deleted.

Loading

0 comments on commit 405301c

Please sign in to comment.