pub fn unless_os<'reg, 'rc>(
h: &Helper<'reg, 'rc>,
r: &'reg Handlebars<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>,
out: &mut dyn Output,
) -> HelperResultExpand description
A templating helper that conditions on values parsed from target
machine’s /etc/os-release file. It is the negated version of
if_os. The querying keys are case agnostic.
Usage:
-
`{{#unless_os “PRETTY_NAME” “foo,bar”}}..baz..{{/unless_os}}
Renders
..baz..only if current machine’s PRETTY_NAME is neither “foo” nor “bar” -
{{#unless_os "id" "foo"}}..baz..{{else}}..qux..{{/unless_os}}Renders
..baz..only if current machine’s ID is NOT “foo”, renders..qux..only if current user’s ID is “foo” -
{{#unless_os "build_id" some.array}}..foo..{{/unless_os}}Renders
..foo..only if current machine’s BUILD_ID is none of the values from the templating variablesome.array(defined in the config file’s [[context]] section)“#,
[[context]]: dt_core::config::ContextConfig