From 7344162e57d2b95d25759f335f907ee0bb4eb50f Mon Sep 17 00:00:00 2001 From: Jeffory Orrok <74276873+jeffory-orrok@users.noreply.github.com> Date: Sat, 22 May 2021 13:36:36 -0600 Subject: [PATCH] actually install the version that we're saying we're installing Include the package name and version in the `yarn` and `npm install` commands. --- src/makePatch.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/makePatch.ts b/src/makePatch.ts index 13696703..d1f781d4 100644 --- a/src/makePatch.ts +++ b/src/makePatch.ts @@ -127,7 +127,7 @@ export function makePatch({ try { // try first without ignoring scripts in case they are required // this works in 99.99% of cases - spawnSafeSync(`yarn`, ["install", "--ignore-engines"], { + spawnSafeSync(`yarn`, ["install", "--ignore-engines", `${packageDetails.name}@${packageVersion}`], { cwd: tmpRepoNpmRoot, logStdErrOnError: false, }) @@ -136,7 +136,7 @@ export function makePatch({ // an implicit context which we havn't reproduced spawnSafeSync( `yarn`, - ["install", "--ignore-engines", "--ignore-scripts"], + ["install", "--ignore-engines", "--ignore-scripts", `${packageDetails.name}@${packageVersion}`], { cwd: tmpRepoNpmRoot, }, @@ -150,7 +150,7 @@ export function makePatch({ try { // try first without ignoring scripts in case they are required // this works in 99.99% of cases - spawnSafeSync(`npm`, ["i", "--force"], { + spawnSafeSync(`npm`, ["i", "--force", `${packageDetails.name}@${packageVersion}`], { cwd: tmpRepoNpmRoot, logStdErrOnError: false, stdio: "ignore", @@ -158,7 +158,7 @@ export function makePatch({ } catch (e) { // try again while ignoring scripts in case the script depends on // an implicit context which we havn't reproduced - spawnSafeSync(`npm`, ["i", "--ignore-scripts", "--force"], { + spawnSafeSync(`npm`, ["i", "--ignore-scripts", "--force", `${packageDetails.name}@${packageVersion}`], { cwd: tmpRepoNpmRoot, stdio: "ignore", })