summaryrefslogtreecommitdiffstats
path: root/src/configs/custom.rs
diff options
context:
space:
mode:
authorJavier Goday <jgoday@gmail.com>2021-06-13 08:23:46 +0200
committerGitHub <noreply@github.com>2021-06-13 08:23:46 +0200
commitfa3899719b473c35029722b2a7dbcea8ab474880 (patch)
tree4ca8703402ee83861f0e8dc078791d685ac3514a /src/configs/custom.rs
parentdc92d664e22f945645c3ac124a592285d5109894 (diff)
feat: Add Operating System condition to custom commands (#2751)
* #2750: Add Operating System condition to custom commands * update custom module config docs * fix os field name in custom module * Fix custom module false positives (when && os conditions) * Custom module operation system: check unix family * Custom module operation system: fix check unix family (use cfg!(unix)) * Update docs/config/README.md Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Diffstat (limited to 'src/configs/custom.rs')
-rw-r--r--src/configs/custom.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/configs/custom.rs b/src/configs/custom.rs
index bced89319..d1f758aa4 100644
--- a/src/configs/custom.rs
+++ b/src/configs/custom.rs
@@ -17,6 +17,8 @@ pub struct CustomConfig<'a> {
pub files: Vec<&'a str>,
pub extensions: Vec<&'a str>,
pub directories: Vec<&'a str>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub os: Option<&'a str>,
}
impl<'a> Default for CustomConfig<'a> {
@@ -33,6 +35,7 @@ impl<'a> Default for CustomConfig<'a> {
files: Vec::default(),
extensions: Vec::default(),
directories: Vec::default(),
+ os: None,
}
}
}