Skip to content

Commit

Permalink
Create directories if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
arranf committed Jan 14, 2019
1 parent 3d31d2f commit 838dc42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn main() {
let index = index_pages(&Path::new(&config.scan_path));
let index = serde_json::to_string(&index).expect("Unable to serialize page index");
println!("Writing index to {0}", &config.index_path);
fs::create_dir_all(Path::new(&config.index_path).with_file_name(EMPTY_STRING)).expect("Error creating directories to write index");
fs::write(config.index_path, index).expect("Error writing index");
}

Expand Down

0 comments on commit 838dc42

Please sign in to comment.