ZDCICBG7ZA5Z673GR2OBPOKAZFMWWWR6TALVC2NWDF3XAB7Y3GYAC
Ok(())
Ok(key_path)
}
// AgentClient Not available on Windows
#[cfg(not(unix))]
async fn do_prompt_ssh() -> Result<Option<PathBuf>, anyhow::Error> {
let ssh_dir = dirs_next::home_dir().unwrap().join(".ssh");
let path = Input::with_theme(config::load_theme()?.as_ref())
.with_prompt("Path to ssh key")
.allow_empty(false)
.with_initial_text(ssh_dir.join("id_rsa").to_str().unwrap_or(""))
.validate_with(move |input: &String| -> Result<(), &str> {
if input.is_empty() {
Err("Must enter a path!")
} else if !Path::new(input).try_exists().unwrap_or(false) {
Err("Path does not exist")
} else{
Ok(())
}
})
.interact_text()?;
let pb = PathBuf::from(path);
Ok(Some(pb))