critical bug in files fixed + cli created
parent
5a9bf795e9
commit
1b12ecc67f
|
|
@ -4,3 +4,4 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
clap = { version = "4.5.22", features = ["derive"] }
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
|
#[derive(Debug, Parser)]
|
||||||
|
pub struct Cli {
|
||||||
|
#[command(
|
||||||
|
subcommand,
|
||||||
|
help = "status|start|stop|restart|",
|
||||||
|
)]
|
||||||
|
command : Commands,
|
||||||
|
}
|
||||||
|
#[derive(Debug, Subcommand)]
|
||||||
|
pub enum Commands {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
mod cli;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,10 @@ pub async fn file_handler(
|
||||||
// * watcher recreation after dealing with file recreation mechanism in text editors
|
// * watcher recreation after dealing with file recreation mechanism in text editors
|
||||||
let mutex = notify.borrow_mut();
|
let mutex = notify.borrow_mut();
|
||||||
|
|
||||||
*mutex = create_watcher(&file.filename, &file.src).await.unwrap();
|
// *mutex = create_watcher(&file.filename, &file.src).await.unwrap();
|
||||||
|
if let Ok(watcher) = create_watcher(&file.filename, &file.src).await {
|
||||||
|
*mutex = watcher;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
match file.triggers.on_change.as_str() {
|
match file.triggers.on_change.as_str() {
|
||||||
"stop" => {
|
"stop" => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue