rename config file
This commit is contained in:
parent
fdb9462d33
commit
848bf842a5
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -280,7 +280,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "mqttAutomation"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
dependencies = [
|
||||
"crossbeam",
|
||||
"json",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mqttAutomation"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
10
src/main.rs
10
src/main.rs
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user