2021-08-21 11:12:40 +02:00
|
|
|
use std::time::Duration;
|
|
|
|
|
2021-10-10 10:04:40 +02:00
|
|
|
use miette::Result;
|
2021-08-21 11:12:40 +02:00
|
|
|
use tokio::time::sleep;
|
2023-11-25 21:33:44 +01:00
|
|
|
use watchexec::{ErrorHook, Watchexec};
|
2021-08-21 11:12:40 +02:00
|
|
|
|
|
|
|
#[tokio::main]
|
2021-10-10 10:04:40 +02:00
|
|
|
async fn main() -> Result<()> {
|
2021-08-21 11:12:40 +02:00
|
|
|
tracing_subscriber::fmt::init();
|
|
|
|
|
2023-11-25 21:33:44 +01:00
|
|
|
let wx = Watchexec::default();
|
|
|
|
wx.config.on_error(|err: ErrorHook| {
|
2022-01-30 14:55:47 +01:00
|
|
|
eprintln!("Watchexec Runtime Error: {}", err.error);
|
2021-08-22 12:05:09 +02:00
|
|
|
});
|
2021-08-21 11:12:40 +02:00
|
|
|
wx.main();
|
|
|
|
|
|
|
|
// TODO: induce an error here
|
|
|
|
|
|
|
|
sleep(Duration::from_secs(1)).await;
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|