diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-21 19:29:17 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-21 19:29:17 +0100 |
commit | a8fe841aaefe904121d936e608572a1422191167 (patch) | |
tree | 0d4bb04670af5a6212938664ec70470841ac8399 /base/src/lib.rs | |
parent | 06d5c0d961c85abb3dd645b65b4447936fe7690f (diff) | |
download | jellything-a8fe841aaefe904121d936e608572a1422191167.tar jellything-a8fe841aaefe904121d936e608572a1422191167.tar.bz2 jellything-a8fe841aaefe904121d936e608572a1422191167.tar.zst |
trakt import
Diffstat (limited to 'base/src/lib.rs')
-rw-r--r-- | base/src/lib.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/base/src/lib.rs b/base/src/lib.rs index 0001caa..48d3b37 100644 --- a/base/src/lib.rs +++ b/base/src/lib.rs @@ -19,9 +19,13 @@ use std::{fs::File, path::PathBuf, sync::LazyLock}; pub static CONF: LazyLock<GlobalConfig> = LazyLock::new(|| { serde_yaml::from_reader( File::open(std::env::var("JELLYTHING_CONFIG").unwrap_or_else(|_| { - std::env::args().nth(1).expect( - "First argument or JELLYTHING_CONFIG must specify the configuration to use.", - ) + if std::env::args().nth(0) == Some("jellything".to_string()) { + std::env::args().nth(1).expect( + "First argument or JELLYTHING_CONFIG must specify the configuration to use.", + ) + } else { + panic!("JELLYTHING_CONFIG variable is required.") + } })) .expect("config cannot be read"), ) |