Skip to content

Commit

Permalink
update confy
Browse files Browse the repository at this point in the history
  • Loading branch information
omallassi committed Apr 18, 2024
1 parent f05bc73 commit 6773323
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion adr_config_local_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
# confy = "0.3.1"
# use git master dep to get the truncate (https://github.com/rust-cli/confy/blob/master/src/lib.rs#L195)
confy = "0.5.1" #{ git = "https://github.com/rust-cli/confy", rev = "5a58388fa9b8bcd790a62c2a9db5abdcbe9fb467"}
confy = "0.6.1" #{ git = "https://github.com/rust-cli/confy", rev = "5a58388fa9b8bcd790a62c2a9db5abdcbe9fb467"}
serde_json = "1.0.107"
serde_yaml = "0.9.25"
serde = "1.0.198"
Expand Down
21 changes: 6 additions & 15 deletions adr_config_local_impl/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
//for now keep it to apply standard murex convention
let cfg: AdrToolConfig = get_config_from_name(config);
let adr_src_dir = String::from(value);
//adr_src_dir.push_str("/src");

let adr_template_dir = Path::new(value).join("templates");

let adr_search_index = Path::new(value).join(".index");

let new_cfg = AdrToolConfig {
Expand All @@ -151,9 +148,8 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
get_logger(),
"Error while updating config file for property [{}] - [{}]", &name, &why
);
AdrToolConfig::default()
}
Ok(_e) => cfg,
Ok(_e) => {}
};
}
if ADR_TEMPLATE_DIR == name {
Expand All @@ -165,9 +161,8 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
get_logger(),
"Error while updating config file for property [{}] - [{}]", &name, &why
);
AdrToolConfig::default()
}
Ok(_e) => cfg,
Ok(_e) => {}
};
}
if ADR_TEMPLATE_FILE == name {
Expand All @@ -179,9 +174,8 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
get_logger(),
"Error while updating config file for property [{}] - [{}]", &name, &why
);
AdrToolConfig::default()
}
Ok(_e) => cfg,
Ok(_e) => {}
};
}
if LOG_LEVEL == name {
Expand All @@ -193,9 +187,8 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
get_logger(),
"Error while updating config file for property [{}] - [{}]", &name, &why
);
AdrToolConfig::default()
}
Ok(_e) => cfg,
Ok(_e) => {}
};
}

Expand All @@ -208,9 +201,8 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
get_logger(),
"Error while updating config file for property [{}] - [{}]", &name, &why
);
AdrToolConfig::default()
}
Ok(_e) => cfg,
Ok(_e) => {}
};
}

Expand All @@ -223,9 +215,8 @@ pub fn set_config_from_name(config: &str, name: &str, value: &str) -> Result<()>
get_logger(),
"Error while updating config file for property [{}] - [{}]", &name, &why
);
AdrToolConfig::default()
}
Ok(_e) => cfg,
Ok(_e) => {}
};
}

Expand Down

0 comments on commit 6773323

Please sign in to comment.