diff --git a/Cargo.lock b/Cargo.lock index 64bd415..4e4c564 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1123,7 +1123,7 @@ dependencies = [ [[package]] name = "ostiary" -version = "1.0.8" +version = "1.0.9" dependencies = [ "anyhow", "crossterm", diff --git a/Cargo.toml b/Cargo.toml index 22466ad..b017d04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ostiary" -version = "1.0.8" +version = "1.0.9" edition = "2024" [dependencies] diff --git a/src/config.rs b/src/config.rs index d7e0027..963555b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -61,10 +61,22 @@ impl Config { server_url: server_url.to_string(), timeout_sec: 10, 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::write(&path, toml::to_string_pretty(&config)?)?; + fs::write(&path, contents)?; Ok(config) } }