mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-25 03:25:56 +00:00
Stabilize server lifecycle, client settings and release qualification
This commit is contained in:
1 parent
4d1a6e0b21
commit
30d2f56997
71 files changed
+2785
-168
No files matched your search
@@ -0,0 +1,13 @@
|
||||
use std::path::Path;
|
||||
|
||||
pub fn close_to_tray(dir: &Path) -> coa_core::Result<bool> {
|
||||
match std::fs::read(dir.join("close-to-tray.json")) {
|
||||
Ok(bytes) => Ok(serde_json::from_slice(&bytes)?),
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(false),
|
||||
Err(e) => Err(e.into()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn save(dir: &Path, enabled: bool) -> coa_core::Result<()> {
|
||||
coa_core::fsx::atomic_write_json(&dir.join("close-to-tray.json"), &enabled)
|
||||
}
|
||||
Reference in new issue
Block a user