diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs | 7 | ||||
-rw-r--r-- | src/main.rs | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index 6b9a89d..805a2c3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,6 +14,9 @@ pub struct Config { /// How often the upload to dps.report should be retried. #[serde(default)] pub retries: u32, + /// Whether ezau should zip non-zipped logs. + #[serde(default = "default_zip")] + pub zip: bool, /// Option Discord information for bot postings. pub discord: Option<Discord>, } @@ -32,3 +35,7 @@ pub fn load<P: AsRef<Path>>(path: P) -> Result<Config> { let content = fs::read(path)?; Ok(toml::from_slice(&content)?) } + +fn default_zip() -> bool { + true +} diff --git a/src/main.rs b/src/main.rs index 395a0b5..d5cee18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -104,7 +104,7 @@ fn watch(watch: &Watch, config: &Config) -> Result<()> { if let DebouncedEvent::Create(path) = event { let path_str = path.to_str().unwrap(); // Check if we need to zip it first. - if raw_evtc_re.is_match(path_str) { + if config.zip && raw_evtc_re.is_match(path_str) { info!("Zipping up {}", path_str); zip_file(&path)?; } else if zip_evtc_re.is_match(path_str) { |