File tree 2 files changed +12
-3
lines changed
cli/npm/managed/resolvers
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ impl<'a> LifecycleScripts<'a> {
62
62
}
63
63
}
64
64
65
- fn has_lifecycle_scripts (
65
+ pub fn has_lifecycle_scripts (
66
66
package : & NpmResolutionPackage ,
67
67
package_path : & Path ,
68
68
) -> bool {
@@ -277,6 +277,10 @@ impl<'a> LifecycleScripts<'a> {
277
277
self . strategy . did_run_scripts ( package) ?;
278
278
}
279
279
280
+ // re-set up bin entries for the packages which we've run scripts for.
281
+ // lifecycle scripts can create files that are linked to by bin entries,
282
+ // and the only reliable way to handle this is to re-link bin entries
283
+ // (this is what PNPM does as well)
280
284
bin_entries. finish_only (
281
285
snapshot,
282
286
& root_node_modules_dir_path. join ( ".bin" ) ,
Original file line number Diff line number Diff line change @@ -664,8 +664,13 @@ async fn sync_resolution_with_fs(
664
664
|setup_outcome| {
665
665
match setup_outcome {
666
666
bin_entries:: EntrySetupOutcome :: MissingEntrypoint {
667
- package, ..
668
- } if lifecycle_scripts. can_run_scripts ( & package. id . nv )
667
+ package,
668
+ package_path,
669
+ ..
670
+ } if super :: common:: lifecycle_scripts:: has_lifecycle_scripts (
671
+ package,
672
+ package_path,
673
+ ) && lifecycle_scripts. can_run_scripts ( & package. id . nv )
669
674
&& !lifecycle_scripts. has_run_scripts ( package) =>
670
675
{
671
676
// ignore, it might get fixed when the lifecycle scripts run.
You can’t perform that action at this time.
0 commit comments