tsk-45: Root directory check #66
10
src/main.rs
10
src/main.rs
@@ -17,8 +17,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
if !app.does_root_directory_exists() {
|
if !app.does_root_directory_exists() {
|
||||||
eprintln!("Root directory does not exist");
|
eprintln!("Root directory does not exist");
|
||||||
|
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);
|
std::process::exit(-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app.token = match auth::get_token(&app).await {
|
app.token = match auth::get_token(&app).await {
|
||||||
Ok(login_result) => {
|
Ok(login_result) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user