Added default update server
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ostiary"
|
name = "ostiary"
|
||||||
version = "1.0.8"
|
version = "1.0.9"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -61,10 +61,22 @@ impl Config {
|
|||||||
server_url: server_url.to_string(),
|
server_url: server_url.to_string(),
|
||||||
timeout_sec: 10,
|
timeout_sec: 10,
|
||||||
theme: default_theme(),
|
theme: default_theme(),
|
||||||
update_api: None,
|
update_api: Some("https://git.vainend.com/api/v1/repos/admin/ostiary".to_string()),
|
||||||
};
|
};
|
||||||
|
let contents = format!(
|
||||||
|
r#"server_url = "{}"
|
||||||
|
timeout_sec = {}
|
||||||
|
update_api = "https://git.vainend.com/api/v1/repos/admin/ostiary"
|
||||||
|
|
||||||
|
[theme]
|
||||||
|
selected_bg = "{}"
|
||||||
|
"#,
|
||||||
|
config.server_url,
|
||||||
|
config.timeout_sec,
|
||||||
|
config.theme.selected_bg,
|
||||||
|
);
|
||||||
fs::create_dir_all(path.parent().unwrap())?;
|
fs::create_dir_all(path.parent().unwrap())?;
|
||||||
fs::write(&path, toml::to_string_pretty(&config)?)?;
|
fs::write(&path, contents)?;
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user