diff options
Diffstat (limited to 'deps/npm/lib/workspaces/get-workspaces.js')
-rw-r--r-- | deps/npm/lib/workspaces/get-workspaces.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/deps/npm/lib/workspaces/get-workspaces.js b/deps/npm/lib/workspaces/get-workspaces.js index a59b5a6c54b..0cddae2a462 100644 --- a/deps/npm/lib/workspaces/get-workspaces.js +++ b/deps/npm/lib/workspaces/get-workspaces.js @@ -5,7 +5,7 @@ const rpj = require('read-package-json-fast') // Returns an Map of paths to workspaces indexed by workspace name // { foo => '/path/to/foo' } -const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => { +const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom }) => { // TODO we need a better error to be bubbled up here if this rpj call fails const pkg = await rpj(resolve(path, 'package.json')) const workspaces = await mapWorkspaces({ cwd: path, pkg }) @@ -21,8 +21,8 @@ const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => { for (const filterArg of filters) { for (const [workspaceName, workspacePath] of workspaces.entries()) { if (filterArg === workspaceName - || resolve(path, filterArg) === workspacePath - || minimatch(workspacePath, `${resolve(path, filterArg)}/*`)) { + || resolve(relativeFrom || path, filterArg) === workspacePath + || minimatch(workspacePath, `${resolve(relativeFrom || path, filterArg)}/*`)) { res.set(workspaceName, workspacePath) } } |