tsk-45: Added more checks
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -17,7 +17,17 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user