From cd6ee65318f01e168cd1643907420dd1d85da111 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Oct 2025 16:06:24 -0400 Subject: [PATCH] tsk-45: Added more checks --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 55a7c22..d48245a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,17 @@ async fn main() -> Result<(), Box> { if !app.does_root_directory_exists() { eprintln!("Root directory does not exist"); - std::process::exit(-1); + println!("Attempting to create directory"); + let path = std::path::Path::new(&app.root_directory); + match std::fs::create_dir(&path) { + Ok(_) => { + println!("Directory created"); + } + Err(err) => { + eprintln!("Error creating directory: {err:?}"); + std::process::exit(-1); + } + } } app.token = match auth::get_token(&app).await {