mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 06:35:39 +00:00
Ripple verbosity flags through the server
This commit is contained in:
@@ -6,17 +6,20 @@ use notify::{DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher};
|
||||
|
||||
use vfs::Vfs;
|
||||
use pathext::path_to_route;
|
||||
use core::Config;
|
||||
|
||||
pub struct VfsWatcher {
|
||||
vfs: Arc<Mutex<Vfs>>,
|
||||
watchers: Vec<RecommendedWatcher>,
|
||||
config: Config,
|
||||
}
|
||||
|
||||
impl VfsWatcher {
|
||||
pub fn new(vfs: Arc<Mutex<Vfs>>) -> VfsWatcher {
|
||||
pub fn new(config: Config, vfs: Arc<Mutex<Vfs>>) -> VfsWatcher {
|
||||
VfsWatcher {
|
||||
vfs,
|
||||
watchers: Vec::new(),
|
||||
config,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +43,7 @@ impl VfsWatcher {
|
||||
|
||||
{
|
||||
let vfs = self.vfs.clone();
|
||||
let config = self.config.clone();
|
||||
|
||||
thread::spawn(move || {
|
||||
loop {
|
||||
@@ -47,6 +51,10 @@ impl VfsWatcher {
|
||||
let mut vfs = vfs.lock().unwrap();
|
||||
let current_time = vfs.current_time();
|
||||
|
||||
if config.verbose {
|
||||
println!("FS event {:?}", event);
|
||||
}
|
||||
|
||||
match event {
|
||||
DebouncedEvent::Write(ref change_path) |
|
||||
DebouncedEvent::Create(ref change_path) |
|
||||
|
||||
Reference in New Issue
Block a user