🥇 export from upstream (6685282)
This commit is contained in:
@@ -334,8 +334,12 @@ pub fn has_legacy_ssh_mount(config: &SandcageConfig) -> bool {
|
||||
}
|
||||
|
||||
pub fn write_ssh_config_to_yaml(path: &Path, entries: &[SshDiscoveryEntry]) -> Result<()> {
|
||||
let content = std::fs::read_to_string(path)
|
||||
.map_err(|e| SetupError::ConfigReadFailed(path.to_path_buf(), e))?;
|
||||
let content = if path.exists() {
|
||||
std::fs::read_to_string(path)
|
||||
.map_err(|e| SetupError::ConfigReadFailed(path.to_path_buf(), e))?
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
|
||||
let mut config: SandcageConfig = if content.trim().is_empty() {
|
||||
SandcageConfig::default()
|
||||
|
||||
Reference in New Issue
Block a user