Skip to content

Commit

Permalink
fix: properly fall back to netrc file (#592)
Browse files Browse the repository at this point in the history
We were early-exiting the loop.
  • Loading branch information
wolfv authored Apr 5, 2024
1 parent 9f8d396 commit 5483bf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ impl NetRcStorage {
Ok(val) => PathBuf::from(val),
Err(_) => match dirs::home_dir() {
Some(mut path) => {
#[cfg(windows)]
path.push("_netrc");
#[cfg(not(windows))]
path.push(".netrc");
path
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ impl AuthenticationStorage {
return Ok(Some(auth));
}
Ok(None) => {
return Ok(None);
continue;
}
Err(e) => {
tracing::warn!("Error retrieving credentials from backend: {}", e);
}
}
}

Err(anyhow!("All backends failed to retrieve credentials"))
Ok(None)
}

/// Retrieve the authentication information for the given URL
Expand Down

0 comments on commit 5483bf9

Please sign in to comment.