cli: Don't error if ssh-agent isn't running

This commit is contained in:
cloudhead 2024-01-31 13:54:39 +01:00
parent 15d1709831
commit 4e9e438f41
No known key found for this signature in database
1 changed files with 9 additions and 3 deletions

View File

@ -193,10 +193,16 @@ pub fn authenticate(options: Options, profile: &Profile) -> anyhow::Result<()> {
ssh::keystore::MemorySigner::load(&profile.keystore, Some(passphrase))
.map_err(|_| anyhow!("`{RAD_PASSPHRASE}` is invalid"))?;
return Ok(());
};
}
// ssh-agent is the de-facto solution.
anyhow::bail!("ssh-agent not running");
term::print(term::format::dim(
"Nothing to do, ssh-agent is not running.",
));
term::print(term::format::dim(
"You will be prompted for a passphrase when necessary.",
));
Ok(())
}
/// Register key with ssh-agent.