mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-16 09:08:37 +01:00
a13bc429eb
Co-authored-by: emilHof <95590295+emilHof@users.noreply.github.com>
22 lines
417 B
Rust
22 lines
417 B
Rust
use std::time::Duration;
|
|
|
|
use miette::Result;
|
|
use tokio::time::sleep;
|
|
use watchexec::{ErrorHook, Watchexec};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
tracing_subscriber::fmt::init();
|
|
|
|
let wx = Watchexec::default();
|
|
wx.config.on_error(|err: ErrorHook| {
|
|
eprintln!("Watchexec Runtime Error: {}", err.error);
|
|
});
|
|
wx.main();
|
|
|
|
// TODO: induce an error here
|
|
|
|
sleep(Duration::from_secs(1)).await;
|
|
|
|
Ok(())
|
|
}
|