From 4d62527e23c08353d203d2487787a386109faf06 Mon Sep 17 00:00:00 2001 From: Bauke Date: Fri, 28 Oct 2022 13:13:53 +0200 Subject: [PATCH] Add the Task struct. --- source/config/mod.rs | 2 ++ source/config/task.rs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 source/config/task.rs diff --git a/source/config/mod.rs b/source/config/mod.rs index 0ded728..60ce7be 100644 --- a/source/config/mod.rs +++ b/source/config/mod.rs @@ -8,8 +8,10 @@ use { }; mod general; +mod task; pub use general::*; +pub use task::*; /// The main Hooked configuration struct. #[derive(Debug, Default, Deserialize, Serialize)] diff --git a/source/config/task.rs b/source/config/task.rs new file mode 100644 index 0000000..663dece --- /dev/null +++ b/source/config/task.rs @@ -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, + + /// Path to a script to execute. + pub script: Option, +}