Don't try to use the netrc if itdoesn't exist

This commit is contained in:
Graham Christensen 2024-11-06 09:47:44 -05:00
parent a68e1c4d54
commit d1983bbdff

View file

@ -313,7 +313,14 @@ async fn main_cli() -> Result<()> {
}
// When determinate-nixd is not available, but the user specified a netrc
(_, Some(path), Dnixd::Missing) => Some(FlakeHubAuthSource::Netrc(path.to_owned())),
(_, Some(path), Dnixd::Missing) => {
if path.exists() {
Some(FlakeHubAuthSource::Netrc(path.to_owned()))
} else {
tracing::debug!(path = %path.display(), "User-provided netrc does not exist");
None
}
}
// User explicitly turned on flakehub cache, but we have no netrc and determinate-nixd is not present
(CacheTrinary::Enabled, None, Dnixd::Missing) => {