Updating function
sender Build / Check (pull_request) Failing after 10s
sender Build / Rustfmt (pull_request) Failing after 38s
sender Build / Test Suite (pull_request) Successful in 39s
sender Build / build (pull_request) Successful in 36s
sender Build / Clippy (pull_request) Successful in 44s

This commit is contained in:
2026-06-06 16:03:47 -04:00
parent 96eee296d5
commit 0a8f41d4ac
+17 -2
View File
@@ -1,7 +1,22 @@
pub const APP_NAME: &str = "sender"; pub const APP_NAME: &str = "sender";
pub fn get_paths(args: Vec<String>) -> (String, String, String) { pub fn get_paths(args: Vec<String>) -> Result<(String, String), std::io::Error> {
(args[1].clone(), args[2].clone(), args[3].clone()) if args.len() < 2 {
Err(std::io::Error::other("Not enough arguments"))
} else {
let numbers_path = args[1].clone();
let message_path = args[2].clone();
if !path_exists(&numbers_path) && !path_exists(&message_path) {
Err(std::io::Error::other("Paths do not exists"))
} else {
Ok((numbers_path, message_path))
}
}
}
fn path_exists(path: &str) -> bool {
let file = std::path::Path::new(path);
file.exists()
} }
pub async fn parse_config() -> (textsender_models::config::auxiliary::TwilioConfig, bool) { pub async fn parse_config() -> (textsender_models::config::auxiliary::TwilioConfig, bool) {