Skip to content

Commit

Permalink
fix(cli): improve registry URL handling in npmrc merging logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawei397 committed Nov 27, 2024
1 parent 452d28b commit 0e4eefa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,14 +611,14 @@ fn discover_npmrc(
merged_scopes.entry(key).or_insert(value);
}
for data in merged_scopes.values_mut() {
let host = data.registry_url.host_str().unwrap();
let port = data.registry_url.port().unwrap_or(4873);
let path = data.registry_url.path();
let url = format!("{}:{}{}", host, port, path);
if let Some(config) = merged_registry_configs.get(&url) {
data.config = config.clone();
if let (Some(host), Some(port)) = (data.registry_url.host_str(), data.registry_url.port()) {
let path = data.registry_url.path();
let url = format!("{}:{}{}", host, port, path);
if let Some(config) = merged_registry_configs.get(&url) {
data.config = config.clone();
}
}
}
}

ResolvedNpmRc {
default_config: merged_default_config,
Expand Down

0 comments on commit 0e4eefa

Please sign in to comment.