@@ -5,7 +5,7 @@ const rpj = require('read-package-json-fast')
55
66// Returns an Map of paths to workspaces indexed by workspace name
77// { foo => '/path/to/foo' }
8- const getWorkspaces = async ( filters , { path, includeWorkspaceRoot } ) => {
8+ const getWorkspaces = async ( filters , { path, includeWorkspaceRoot, relativeFrom } ) => {
99 // TODO we need a better error to be bubbled up here if this rpj call fails
1010 const pkg = await rpj ( resolve ( path , 'package.json' ) )
1111 const workspaces = await mapWorkspaces ( { cwd : path , pkg } )
@@ -21,8 +21,8 @@ const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => {
2121 for ( const filterArg of filters ) {
2222 for ( const [ workspaceName , workspacePath ] of workspaces . entries ( ) ) {
2323 if ( filterArg === workspaceName
24- || resolve ( path , filterArg ) === workspacePath
25- || minimatch ( workspacePath , `${ resolve ( path , filterArg ) } /*` ) ) {
24+ || resolve ( relativeFrom || path , filterArg ) === workspacePath
25+ || minimatch ( workspacePath , `${ resolve ( relativeFrom || path , filterArg ) } /*` ) ) {
2626 res . set ( workspaceName , workspacePath )
2727 }
2828 }
0 commit comments