Add templating flags

main
trivernis 11 months ago
parent ab74021bae
commit 407561cd38
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -22,6 +22,7 @@ pub fn context<'a>() -> &'a ContextData {
pub struct ContextData {
pub dirs: ContextDirs,
pub system: SystemData,
pub flags: Flags,
}
#[derive(Clone, Debug, Serialize)]
@ -75,3 +76,22 @@ impl Default for ContextDirs {
}
}
}
#[derive(Clone, Debug, Serialize)]
pub struct Flags {
windows: bool,
unix: bool,
linux: bool,
macos: bool,
}
impl Default for Flags {
fn default() -> Self {
Self {
windows: cfg!(windows),
unix: cfg!(unix),
linux: cfg!(target_os = "linux"),
macos: cfg!(target_os = "macos"),
}
}
}

Loading…
Cancel
Save