diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-24 20:04:19 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-24 20:04:19 +0200 |
commit | 5ee01d06c0b067f2f07d0288c499897cd0df29f7 (patch) | |
tree | 91dd323219a2102770d40919d5e713b03f48b1e5 /base/src/lib.rs | |
parent | d9b3b92e8ddd27aac39269a03a0eeb18e3a62a6a (diff) | |
download | jellything-5ee01d06c0b067f2f07d0288c499897cd0df29f7.tar jellything-5ee01d06c0b067f2f07d0288c499897cd0df29f7.tar.bz2 jellything-5ee01d06c0b067f2f07d0288c499897cd0df29f7.tar.zst |
migration tool
Diffstat (limited to 'base/src/lib.rs')
-rw-r--r-- | base/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/base/src/lib.rs b/base/src/lib.rs index 5d96b1a..cfc5a11 100644 --- a/base/src/lib.rs +++ b/base/src/lib.rs @@ -5,20 +5,20 @@ */ #![feature(lazy_cell)] pub mod cache; +pub mod database; pub mod permission; pub mod temp; -pub mod database; use jellycommon::{config::GlobalConfig, AssetLocation}; use std::{fs::File, path::PathBuf, sync::LazyLock}; pub static CONF: LazyLock<GlobalConfig> = LazyLock::new(|| { serde_yaml::from_reader( - File::open( - std::env::args() - .nth(1) - .expect("First argument must specify the configuration to use."), - ) + 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.", + ) + })) .unwrap(), ) .unwrap() |