Migrate #4

Merged
phoenix merged 26 commits from migrate into v0.1.x 2026-06-06 17:47:45 -04:00
Showing only changes of commit 0a8f41d4ac - Show all commits
+17 -2
View File
@@ -1,7 +1,22 @@
pub const APP_NAME: &str = "sender";
pub fn get_paths(args: Vec<String>) -> (String, String, String) {
(args[1].clone(), args[2].clone(), args[3].clone())
pub fn get_paths(args: Vec<String>) -> Result<(String, String), std::io::Error> {
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) {