mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-04 15:24:02 -04: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,
|
pkgRoot: rootDir,
|
||||||
rootModulesDir: modulesDir,
|
rootModulesDir: modulesDir,
|
||||||
}
|
}
|
||||||
|
let isBuilt = false
|
||||||
for (const stage of (importerStages ?? stages)) {
|
for (const stage of (importerStages ?? stages)) {
|
||||||
if ((manifest.scripts == null) || !manifest.scripts[stage]) continue
|
if ((manifest.scripts == null) || !manifest.scripts[stage]) continue
|
||||||
await runLifecycleHook(stage, manifest, runLifecycleHookOpts)
|
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 })
|
const filesResponse = await fetchFromDir(rootDir, { resolveSymlinks: opts.resolveSymlinksInInjectedDirs })
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
targetDirs.map(async (targetDir) => {
|
targetDirs.map(async (targetDir) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user