diff options
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"), ) |