critical bug in files fixed + cli created

pull/11/head
prplV 2024-12-04 12:55:26 +03:00
parent 5a9bf795e9
commit 1b12ecc67f
4 changed files with 21 additions and 1 deletions

View File

@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
clap = { version = "4.5.22", features = ["derive"] }

14
noxis-cli/src/cli.rs Normal file
View File

@ -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 {
}

View File

@ -1,3 +1,5 @@
mod cli;
fn main() { fn main() {
println!("Hello, world!"); println!("Hello, world!");
} }

View File

@ -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" => {