From 5577615aff0f56e9104ecd76d23269dfef4cf511 Mon Sep 17 00:00:00 2001 From: Rowan Lonsdale Date: Wed, 21 Nov 2018 12:02:09 +0000 Subject: [PATCH 1/3] Check PnP dep has `.bin` dir before adding to `PATH` --- src/util/execute-lifecycle-script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/execute-lifecycle-script.js b/src/util/execute-lifecycle-script.js index 7401cc10e8..8205c59c5e 100644 --- a/src/util/execute-lifecycle-script.js +++ b/src/util/execute-lifecycle-script.js @@ -217,7 +217,10 @@ export async function makeEnv( continue; } - pathParts.unshift(`${dependencyInformation.packageLocation}/.bin`); + const binFolder = `${dependencyInformation.packageLocation}/.bin`; + if (await fs.exists(binFolder)) { + pathParts.unshift(binFolder); + } } // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment From 1090ac905aa35204bfaa83cfd0a3ba1501bc6b9c Mon Sep 17 00:00:00 2001 From: Rowan Lonsdale Date: Wed, 21 Nov 2018 12:15:48 +0000 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e7d9252a..ea3fb600dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa - Fixes a resolution issue when a package had an invalid `main` entry [#6682](https://github.com/yarnpkg/yarn/pull/6682) - [**Maël Nison**](https://twitter.com/arcanis) + +- Fixes corruption of `PATH` when executing lifecycle scripts on Winows in 'pnp' mode + + [#6683](https://github.com/yarnpkg/yarn/issues/6683) - [**Rowan Lonsdale**](https://github.com/hWorblehat) ## 1.12.3 From 458ed440f239ac0f6f8537ee673f30d1624cdd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Wed, 21 Nov 2018 12:25:07 +0000 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea3fb600dc..c0875f0442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,9 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa - Fixes a resolution issue when a package had an invalid `main` entry [#6682](https://github.com/yarnpkg/yarn/pull/6682) - [**Maël Nison**](https://twitter.com/arcanis) - -- Fixes corruption of `PATH` when executing lifecycle scripts on Winows in 'pnp' mode - + +- Decreases the size of the generated `$PATH` environment variable for a better Windows support + [#6683](https://github.com/yarnpkg/yarn/issues/6683) - [**Rowan Lonsdale**](https://github.com/hWorblehat) ## 1.12.3