Skip to content

Commit b20fbfa

Browse files
committed
Reload arborist after pnpm install
1 parent 41f4150 commit b20fbfa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/commands/fix/pnpm-fix.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type InstallOptions = {
3939

4040
async function install(
4141
pkgEnvDetails: EnvDetails,
42+
arb: SafeArborist,
4243
options: InstallOptions
4344
): Promise<void> {
4445
const { spinner } = { __proto__: null, ...options } as InstallOptions
@@ -47,6 +48,8 @@ async function install(
4748
spinner,
4849
stdio: isDebug() ? 'inherit' : 'ignore'
4950
})
51+
arb.actualTree = null
52+
await arb.loadActual()
5053
}
5154

5255
export async function pnpmFix(
@@ -189,7 +192,7 @@ export async function pnpmFix(
189192
saved = true
190193

191194
// eslint-disable-next-line no-await-in-loop
192-
await install(pkgEnvDetails, { spinner })
195+
await install(pkgEnvDetails, arb, { spinner })
193196
installed = true
194197

195198
if (test) {
@@ -223,10 +226,7 @@ export async function pnpmFix(
223226
}
224227
if (installed) {
225228
// eslint-disable-next-line no-await-in-loop
226-
await install(pkgEnvDetails, { spinner })
227-
arb.actualTree = null
228-
// eslint-disable-next-line no-await-in-loop
229-
await arb.loadActual()
229+
await install(pkgEnvDetails, arb, { spinner })
230230
}
231231
spinner?.failAndStop(`Failed to fix ${oldSpec}`)
232232
}

0 commit comments

Comments
 (0)