Skip to content

Commit dd58a7c

Browse files
committed
Split out revert per pr
1 parent 11530dd commit dd58a7c

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/commands/fix/pnpm-fix.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -350,27 +350,25 @@ export async function pnpmFix(
350350
errored = true
351351
}
352352

353-
if (errored || isCi) {
353+
if (errored) {
354354
editablePkgJson.update(revertData)
355-
355+
// eslint-disable-next-line no-await-in-loop
356+
await Promise.all([removeNodeModules(cwd), editablePkgJson.save()])
357+
// eslint-disable-next-line no-await-in-loop
358+
actualTree = await install(pkgEnvDetails, { spinner })
359+
spinner?.failAndStop(
360+
`Update failed for ${oldSpec} in ${workspaceName}`,
361+
error
362+
)
363+
} else if (isCi) {
356364
// eslint-disable-next-line no-await-in-loop
357365
await Promise.all([
358366
removeNodeModules(cwd),
359-
...(isCi
360-
? [gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)]
361-
: []),
362-
...(isCi ? [] : [editablePkgJson.save()])
367+
// Reset to base branch to isolate next PR
368+
gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
363369
])
364-
365370
// eslint-disable-next-line no-await-in-loop
366371
actualTree = await install(pkgEnvDetails, { spinner })
367-
368-
if (errored) {
369-
spinner?.failAndStop(
370-
`Update failed for ${oldSpec} in ${workspaceName}`,
371-
error
372-
)
373-
}
374372
}
375373
}
376374
}

0 commit comments

Comments
 (0)