We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 54b9710 + 6eb0c4b commit 4b2871dCopy full SHA for 4b2871d
src/cmd/clean.rs
@@ -29,7 +29,10 @@ pub fn execute(args: &ArgMatches) -> mdbook::errors::Result<()> {
29
Some(dest_dir) => dest_dir.into(),
30
None => book.root.join(&book.config.build.build_dir),
31
};
32
- fs::remove_dir_all(&dir_to_remove).chain_err(|| "Unable to remove the build directory")?;
+
33
+ if dir_to_remove.exists() {
34
+ fs::remove_dir_all(&dir_to_remove).chain_err(|| "Unable to remove the build directory")?;
35
+ }
36
37
Ok(())
38
}
0 commit comments