mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
fix: don't relink injected packages if they were not built (#5792)
This commit is contained in:
6
.changeset/soft-peaches-boil.md
Normal file
6
.changeset/soft-peaches-boil.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/lifecycle": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't relink injected directories if they were not built.
|
||||
@@ -49,11 +49,13 @@ export async function runLifecycleHooksConcurrently (
|
||||
pkgRoot: rootDir,
|
||||
rootModulesDir: modulesDir,
|
||||
}
|
||||
let isBuilt = false
|
||||
for (const stage of (importerStages ?? stages)) {
|
||||
if ((manifest.scripts == null) || !manifest.scripts[stage]) continue
|
||||
await runLifecycleHook(stage, manifest, runLifecycleHookOpts)
|
||||
isBuilt = true
|
||||
}
|
||||
if (targetDirs == null || targetDirs.length === 0) return
|
||||
if (targetDirs == null || targetDirs.length === 0 || !isBuilt) return
|
||||
const filesResponse = await fetchFromDir(rootDir, { resolveSymlinks: opts.resolveSymlinksInInjectedDirs })
|
||||
await Promise.all(
|
||||
targetDirs.map(async (targetDir) => {
|
||||
|
||||
Reference in New Issue
Block a user