File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -237,12 +237,17 @@ pub fn generate(
237
237
if watch {
238
238
let mut hotwatch = Hotwatch :: new ( ) . expect ( "Failed to initialize hotwatch!" ) ;
239
239
let watch_folder = Arc :: clone ( input_folder) . as_path ( ) . to_path_buf ( ) ;
240
+ let out_folder = Arc :: clone ( output_folder) . as_path ( ) . to_path_buf ( ) ;
240
241
// Watch the input folder for changes
241
242
hotwatch
242
243
. watch ( watch_folder, move |event : Event | match event. kind {
243
244
EventKind :: Create ( _) | EventKind :: Modify ( _) | EventKind :: Remove ( _) => {
244
- info ! ( "Change detected. Rebuilding site..." ) ;
245
- rebuild ( ) ;
245
+ for ev in event. paths . iter ( ) {
246
+ if !ev. starts_with ( fs:: canonicalize ( out_folder. clone ( ) ) . unwrap ( ) ) {
247
+ info ! ( "Change detected. Rebuilding site..." ) ;
248
+ rebuild ( ) ;
249
+ }
250
+ }
246
251
}
247
252
_ => { }
248
253
} )
You can’t perform that action at this time.
0 commit comments