feat(desktop): add per-instance desktop shortcut toggle
This commit is contained in:
1 parent
3047086fa2
commit
e18b18c0be
9 files changed
+172
-5
No files matched your search
@@ -272,7 +272,12 @@ impl InstanceManager {
|
||||
return Err(InstanceError::NotFound(name.to_string()));
|
||||
}
|
||||
match std::fs::remove_dir_all(&instance_dir) {
|
||||
Ok(_) => Ok(()),
|
||||
Ok(_) => {
|
||||
if let Err(e) = crate::instance::desktop::remove(name) {
|
||||
tracing::warn!("Failed to remove desktop shortcut for '{}': {}", name, e);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!("Failed to delete instance '{}': {}", name, e);
|
||||
Err(InstanceError::Io(e))
|
||||
@@ -307,6 +312,9 @@ impl InstanceManager {
|
||||
if let Ok(json) = serde_json::to_string_pretty(&config) {
|
||||
let _ = std::fs::write(&config_path, json);
|
||||
}
|
||||
if let Err(e) = crate::instance::desktop::rename(old_name, &config) {
|
||||
tracing::warn!("Failed to rename desktop shortcut: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user