tsk-45: Root directory check #66

Merged
phoenix merged 5 commits from tsk-45 into main 2025-10-23 20:18:06 +00:00
2 changed files with 2 additions and 6 deletions
Showing only changes of commit 11332b58a1 - Show all commits

View File

@@ -9,11 +9,7 @@ pub struct App {
impl App {
pub fn does_root_directory_exists(&self) -> bool {
let path = std::path::Path::new(&self.root_directory);
if path.exists() {
if path.is_dir() { true } else { false }
} else {
false
}
if path.exists() { path.is_dir() } else { false }
}
}

View File

@@ -19,7 +19,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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) {
match std::fs::create_dir(path) {
Ok(_) => {
println!("Directory created");
}