Start verification at most recently modified file
This commit is contained in:
@@ -52,7 +52,7 @@ fn main() {
|
||||
}
|
||||
|
||||
if matches.subcommand_matches("verify").is_some() {
|
||||
match verify() {
|
||||
match verify(None) {
|
||||
Ok(_) => {}
|
||||
Err(_) => std::process::exit(1),
|
||||
}
|
||||
@@ -81,14 +81,14 @@ fn watch() -> notify::Result<()> {
|
||||
let mut watcher: RecommendedWatcher = Watcher::new(tx, Duration::from_secs(2))?;
|
||||
watcher.watch("./exercises", RecursiveMode::Recursive)?;
|
||||
|
||||
let _ignored = verify();
|
||||
let _ignored = verify(None);
|
||||
|
||||
loop {
|
||||
match rx.recv() {
|
||||
Ok(event) => match event {
|
||||
DebouncedEvent::Create(b) | DebouncedEvent::Chmod(b) | DebouncedEvent::Write(b) => {
|
||||
if b.extension() == Some(OsStr::new("rs")) {
|
||||
let _ignored = verify();
|
||||
let _ignored = verify(Some(b.as_path().to_str().unwrap()));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
Reference in New Issue
Block a user