issue 150: some issues with configuration (#151)

* issue 150: some issues with configuration
This commit is contained in:
Christian Visintin
2023-02-28 10:45:07 +01:00
committed by GitHub
parent 67df3dc76a
commit 1ecef6fc16
4 changed files with 33 additions and 9 deletions

View File

@@ -52,8 +52,15 @@ impl Default for RemoteConfig {
let mut ssh_config_path = "~/.ssh/config".to_string();
ssh_config_path = ssh_config_path.replacen('~', &home_dir.to_string_lossy(), 1);
// check if ssh config path exists first
let ssh_config_path = if PathBuf::from(&ssh_config_path).exists() {
Some(ssh_config_path)
} else {
None
};
Self {
ssh_config: Some(ssh_config_path),
ssh_config: ssh_config_path,
ssh_keys: HashMap::default(),
}
}