rename config file

This commit is contained in:
Laila van Reenen 2025-01-25 14:56:29 +01:00
parent fdb9462d33
commit 848bf842a5
Signed by: LailaTheElf
GPG Key ID: 8A3EF0226518C12D
4 changed files with 7 additions and 7 deletions

2
Cargo.lock generated
View File

@ -280,7 +280,7 @@ dependencies = [
[[package]]
name = "mqttAutomation"
version = "1.0.0"
version = "1.0.1"
dependencies = [
"crossbeam",
"json",

View File

@ -1,6 +1,6 @@
[package]
name = "mqttAutomation"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
[dependencies]

View File

@ -142,13 +142,13 @@ enum SettingsError {
fn read_config() -> Result<Settings,SettingsError> {
let mut config_str: String = String::from("error");
match fs::read_to_string("./mqttClock.yml") {
match fs::read_to_string("./mqttAutomation.yml") {
Err(_) => {
println!("INFO : read_config: could not find './mqttClock.yml'. try '~/.config/mqttClock.yml");
match fs::read_to_string("~/.config/mqttClock.yml") {
println!("INFO : read_config: could not find './mqttAutomation.yml'. try '~/.config/mqttAutomation.yml");
match fs::read_to_string("~/.config/mqttAutomation.yml") {
Err(_) => {
println!("INFO : read_config: could not find '~/.config/mqttClock.yml'. try '/etc/mqttClock.yml");
match fs::read_to_string("/etc/mqttClock.yml") {
println!("INFO : read_config: could not find '~/.config/mqttAutomation.yml'. try '/etc/mqttAutomation.yml");
match fs::read_to_string("/etc/mqttAutomation.yml") {
Err(_) => println!("ERROR: read_config: could not find any config file"),
Ok(str) => config_str = str
}