@@ -5,14 +5,14 @@ use notify::{EventKind, RecursiveMode, Watcher, recommended_watcher};
55use std:: sync:: mpsc:: channel;
66use std:: time:: { Duration , Instant } ;
77
8- pub async fn watch_for_changes ( path : Option < String > ) {
8+ pub async fn watch_for_changes ( path : Option < String > , with_warning : bool ) {
99 let dir_path = path. unwrap_or_else ( || "./definitions" . to_string ( ) ) ;
1010
1111 info ( format ! ( "Watching directory: {dir_path}" ) ) ;
1212 info ( String :: from ( "Press Ctrl+C to stop watching..." ) ) ;
1313
1414 {
15- Analyser :: new ( dir_path. as_str ( ) ) . report ( false ) ;
15+ Analyser :: new ( dir_path. as_str ( ) ) . report ( false , with_warning ) ;
1616 }
1717
1818 // Set up file watcher
@@ -35,7 +35,7 @@ pub async fn watch_for_changes(path: Option<String>) {
3535 "\n \n \n --------------------------------------------------------------------------\n \n " ,
3636 ) ) ;
3737 info ( String :: from ( "Change detected! Regenerating report..." ) ) ;
38- Analyser :: new ( dir_path. as_str ( ) ) . report ( false ) ;
38+ Analyser :: new ( dir_path. as_str ( ) ) . report ( false , with_warning ) ;
3939 last_run = Instant :: now ( ) ;
4040 }
4141 }
@@ -45,7 +45,7 @@ pub async fn watch_for_changes(path: Option<String>) {
4545 "\n \n \n --------------------------------------------------------------------------\n \n " ,
4646 ) ) ;
4747 info ( String :: from ( "Change detected! Regenerating report..." ) ) ;
48- Analyser :: new ( dir_path. as_str ( ) ) . report ( false ) ;
48+ Analyser :: new ( dir_path. as_str ( ) ) . report ( false , with_warning ) ;
4949 last_run = Instant :: now ( ) ;
5050 }
5151 }
0 commit comments