diff --git a/src/config/mod.rs b/src/config/mod.rs index b0c8d67..9b39933 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1,6 +1,6 @@ pub const APP_NAME: &str = "sender"; -pub fn get_paths(args: &Vec) -> (String, String, String) { +pub fn get_paths(args: Vec) -> (String, String, String) { (args[1].clone(), args[2].clone(), args[3].clone()) } @@ -16,37 +16,13 @@ pub async fn parse_config() -> (textsender_models::config::auxiliary::TwilioConf config.auth_token = auth_token_var.value; config.phone_number = phone_number_var.value; config.service_sid = service_sid_var.value; + let success = { + !config.account_sid.is_empty() && !config.auth_token.is_empty() && !config.phone_number.is_empty() && !config.service_sid.is_empty() + }; - (config, true) + (config, success) } -/* - axlry "git.kundeng.us/phoenix/textsender-models/tx0/config/auxiliary" -) - -func ParseConfig(filepath string) (config axlry.TwilioConfig, success bool) { - content, err := os.ReadFile(filepath) - - log.Println("Reading config file...") - log.Println(filepath) - - if err != nil { - log.Println("An error reading the file") - return - } - - err = json.Unmarshal(content, &config) - - if err != nil { - log.Println("An error occurred") - return config, false - } - - return config, true -} - -*/ - #[cfg(test)] mod tests { #[test]