File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -84,16 +84,14 @@ pub fn parse_bare_identifier(specifier: &str) -> Result<(String, Option<String>)
84
84
} )
85
85
}
86
86
87
- pub fn find_closest_pnp_manifest_path < P : AsRef < Path > > ( p : P ) -> Option < PathBuf > {
88
- let pnp_path = p. as_ref ( ) . join ( ".pnp.cjs" ) ;
89
-
90
- if pnp_path. exists ( ) {
91
- Some ( pnp_path)
92
- } else if let Some ( directory_path) = p. as_ref ( ) . parent ( ) {
93
- find_closest_pnp_manifest_path ( directory_path)
94
- } else {
95
- None
87
+ pub fn find_closest_pnp_manifest_path ( path : & Path ) -> Option < PathBuf > {
88
+ for p in path. ancestors ( ) {
89
+ let pnp_path = p. join ( ".pnp.cjs" ) ;
90
+ if pnp_path. exists ( ) {
91
+ return Some ( pnp_path) ;
92
+ }
96
93
}
94
+ None
97
95
}
98
96
99
97
pub fn load_pnp_manifest < P : AsRef < Path > > ( p : P ) -> Result < Manifest , Error > {
You can’t perform that action at this time.
0 commit comments