Skip to content
This repository has been archived by the owner on May 6, 2019. It is now read-only.

Commit

Permalink
Fix yarnpkg#5816: Trailing slash with workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Y0hy0h committed May 15, 2018
1 parent f72f5a1 commit d626b1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/config.js
Expand Up @@ -633,7 +633,15 @@ export default class Config {
const ws = extractWorkspaces(manifest);
if (ws && ws.packages) {
const relativePath = path.relative(current, initial);
if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) {
// Make packages trailing-slash-agnostic
const sanitizedPackages = ws.packages.map(packageGlob => {
if (packageGlob.endsWith('/')) {
packageGlob = packageGlob.slice(0, -1);
}
return packageGlob + '{,/}';
});

if (relativePath === '' || micromatch.any(relativePath, sanitizedPackages)) {
return current;
} else {
return null;
Expand Down

0 comments on commit d626b1c

Please sign in to comment.