🥇 export from upstream (6685282)

This commit is contained in:
2026-05-23 19:58:23 +02:00
parent 91a62fdb85
commit 7c0a5244cf
+6 -2
View File
@@ -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<()> { pub fn write_ssh_config_to_yaml(path: &Path, entries: &[SshDiscoveryEntry]) -> Result<()> {
let content = std::fs::read_to_string(path) let content = if path.exists() {
.map_err(|e| SetupError::ConfigReadFailed(path.to_path_buf(), e))?; 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() { let mut config: SandcageConfig = if content.trim().is_empty() {
SandcageConfig::default() SandcageConfig::default()