Add the Task struct.

This commit is contained in:
Bauke 2022-10-28 13:13:53 +02:00
parent 3846a62591
commit 4d62527e23
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 18 additions and 0 deletions

View File

@ -8,8 +8,10 @@ use {
}; };
mod general; mod general;
mod task;
pub use general::*; pub use general::*;
pub use task::*;
/// The main Hooked configuration struct. /// The main Hooked configuration struct.
#[derive(Debug, Default, Deserialize, Serialize)] #[derive(Debug, Default, Deserialize, Serialize)]

16
source/config/task.rs Normal file
View File

@ -0,0 +1,16 @@
//! Task to perform in hooks.
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
/// Task to perform in hooks.
#[derive(Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Task {
/// Command to execute directly.
pub command: Option<String>,
/// Path to a script to execute.
pub script: Option<PathBuf>,
}