Skip to content

Commit

Permalink
Cleanup .bin folders from node_modules (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
larixer authored Apr 17, 2020
1 parent fc6ccb2 commit a17c83c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .yarn/versions/1007e617.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
releases:
"@yarnpkg/cli": prerelease
"@yarnpkg/plugin-pnp": prerelease

declined:
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-node-modules"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ describe(`Plug'n'Play`, () => {
test(
`it should remove lingering folders from the node_modules even when they contain dot-folders`,
makeTemporaryEnv({}, async ({path, run, source}) => {
await xfs.mkdirpPromise(`${path}/node_modules/.bin`);
await xfs.mkdirpPromise(`${path}/node_modules/.cache`);
await xfs.mkdirpPromise(`${path}/node_modules/foo`);

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-pnp/sources/PnpLinker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class PnpInstaller extends AbstractPnpInstaller {
});

const nonCacheEntries = directoryListing.filter(entry => {
return !entry.isDirectory() || !entry.name.startsWith(`.`);
return !entry.isDirectory() || entry.name === '.bin' || !entry.name.startsWith(`.`);
});

if (nonCacheEntries.length === directoryListing.length) {
Expand Down

0 comments on commit a17c83c

Please sign in to comment.