Compare commits
4 Commits
v0.4.9
...
c79a2cf98e
| Author | SHA1 | Date | |
|---|---|---|---|
|
c79a2cf98e
|
|||
|
cd6ee65318
|
|||
|
ae8aaad068
|
|||
|
7e50c30e06
|
@@ -9,7 +9,11 @@ pub struct App {
|
|||||||
impl App {
|
impl App {
|
||||||
pub fn does_root_directory_exists(&self) -> bool {
|
pub fn does_root_directory_exists(&self) -> bool {
|
||||||
let path = std::path::Path::new(&self.root_directory);
|
let path = std::path::Path::new(&self.root_directory);
|
||||||
if path.exists() { path.is_dir() } else { false }
|
if path.exists() {
|
||||||
|
if path.is_dir() { true } else { false }
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
eprintln!("Root directory does not exist");
|
eprintln!("Root directory does not exist");
|
||||||
println!("Attempting to create directory");
|
println!("Attempting to create directory");
|
||||||
let path = std::path::Path::new(&app.root_directory);
|
let path = std::path::Path::new(&app.root_directory);
|
||||||
match std::fs::create_dir(path) {
|
match std::fs::create_dir(&path) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
println!("Directory created");
|
println!("Directory created");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user