From f1ea0a67dfa2ecc82ae1f40ca717072314b2d13e Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Wed, 26 Jul 2017 00:49:59 +0200 Subject: [PATCH] Add common files to generated .gitignore --- src/book/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/book/mod.rs b/src/book/mod.rs index d5effb93..7136cda1 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -221,7 +221,14 @@ impl MDBook { debug!("[*]: Writing to .gitignore"); + // Write the destination folder to file writeln!(f, "{}", relative).expect("Could not write to file."); + + // Add common files + let ignores = vec!("*~", ".DS_Store"); + for pattern in ignores { + writeln!(f, "{}", pattern).expect("Could not write to file."); + } } }