diff options
author | Alexander Kjäll <alexander.kjall@gmail.com> | 2023-01-27 21:11:20 +0100 |
---|---|---|
committer | andy.boot <bootandy@gmail.com> | 2023-01-27 22:45:45 +0000 |
commit | 712acc67fe267e5fce6d154121ef48e4b78e3639 (patch) | |
tree | 2f402b1505652ae4d68577ec53c6f6efe46f6129 | |
parent | fdbed14334a9c051e8dadce24aaa492aa9cc80c5 (diff) |
use create_dir_all instead of create_dir as that doesn't fail if the directory already exists, and make sure to propagate the error out
-rw-r--r-- | build.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,8 +1,8 @@ use clap_complete::{generate_to, shells::*}; +use clap_mangen::Man; +use std::fs::File; use std::io::Error; use std::path::Path; -use std::fs::File; -use clap_mangen::Man; include!("src/cli.rs"); @@ -18,8 +18,8 @@ fn main() -> Result<(), Error> { generate_to(Elvish, &mut cmd, app_name, outdir)?; let file = Path::new("man-page").join("dust.1"); - std::fs::create_dir("man-page"); - let mut file = File::create(&file)?; + std::fs::create_dir_all("man-page")?; + let mut file = File::create(file)?; Man::new(cmd).render(&mut file)?; |