Skip to content

Commit

Permalink
fix: don't relink injected packages if they were not built (#5792)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Dec 13, 2022
1 parent 90ec7fc commit 6b00a83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/soft-peaches-boil.md
@@ -0,0 +1,6 @@
---
"@pnpm/lifecycle": patch
"pnpm": patch
---

Don't relink injected directories if they were not built.
4 changes: 3 additions & 1 deletion exec/lifecycle/src/runLifecycleHooksConcurrently.ts
Expand Up @@ -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) => {
Expand Down

0 comments on commit 6b00a83

Please sign in to comment.