aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-07-20 16:05:11 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-07-20 16:05:11 +0200
commit5d10f0c200bead79f20503ee7d4d908246d753c7 (patch)
tree6705e18a7295cd3f97d40094d2f20432355f918d /src/config.rs
parent8a7897f28c63812afaabe26ae759dfdcec01f9e2 (diff)
downloadezau-5d10f0c200bead79f20503ee7d4d908246d753c7.tar.gz
ezau-5d10f0c200bead79f20503ee7d4d908246d753c7.tar.bz2
ezau-5d10f0c200bead79f20503ee7d4d908246d753c7.zip
allow zipping to be disabled
If you use ezau on Windows, you might prefer to use the built-in zipping functionality from arcDPS instead of relying on ezau to do this job. However, that would lead to weird interactions because arcDPS would still create the temporary file in the watched folder, and powershell would race with ezau to zip and delete this temporary file. To prevent this from breaking existing (& working) configurations - and to stick true to the name - zipping is enabled by default if not given otherwise in the configuration.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs7
1 files changed, 7 insertions, 0 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
+}