2022-10-28 10:23:05 +00:00
|
|
|
//! General configuration definitions.
|
|
|
|
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
/// General Hooked configuration.
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
|
|
#[serde(default, deny_unknown_fields)]
|
|
|
|
pub struct General {
|
2022-11-01 12:38:52 +00:00
|
|
|
/// Path to the Hooked configuration file.
|
|
|
|
pub config: PathBuf,
|
|
|
|
|
2022-10-28 10:23:05 +00:00
|
|
|
/// The directory to use for hooks.
|
|
|
|
pub directory: PathBuf,
|
2022-11-04 18:00:09 +00:00
|
|
|
|
|
|
|
/// Path to a script template for use with the install subcommand.
|
|
|
|
pub template: Option<PathBuf>,
|
2022-10-28 10:23:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for General {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
2022-11-01 12:38:52 +00:00
|
|
|
config: PathBuf::from("Hooked.toml"),
|
2022-10-28 10:23:05 +00:00
|
|
|
directory: PathBuf::from("hooks"),
|
2022-11-04 18:00:09 +00:00
|
|
|
template: None,
|
2022-10-28 10:23:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|