🥇 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<()> {
|
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user