Skip to content

Commit

Permalink
Allow for non-existent ssh config file
Browse files Browse the repository at this point in the history
  • Loading branch information
milliams committed Jul 12, 2024
1 parent e8d88ab commit 2aa63d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,8 @@ fn main() -> Result<()> {
let config = jump_config + &alias_configs.join("\n");
match command {
Some(SshConfigCommands::Write { ssh_config }) => {
let current_config = std::fs::read_to_string(ssh_config).context(format!(
"Cannot read SSH config file {}",
ssh_config.display()
))?;
// TODO allow tilde in custom path
let current_config = std::fs::read_to_string(ssh_config).unwrap_or_default();
let clifton_ssh_config_file = ssh_config.with_file_name("config_clifton");
let include_line = format!("Include {}\n", clifton_ssh_config_file.display());
if !current_config.contains(&include_line) {
Expand Down

0 comments on commit 2aa63d3

Please sign in to comment.