aboutsummaryrefslogtreecommitdiff
path: root/base/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-25 12:21:27 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-25 12:21:27 +0200
commita491792196c034efbd2f8998944af3f7958c0e52 (patch)
treea295342aef8cd38e32b05af273ff305b7f2a5cc5 /base/src/lib.rs
parent5aa2a6fa5a6f8daf3ed4d86082658027a44f83c8 (diff)
parent8fc2d47f1f6cde93554ba096b959b3bef3652ac1 (diff)
downloadjellything-a491792196c034efbd2f8998944af3f7958c0e52.tar
jellything-a491792196c034efbd2f8998944af3f7958c0e52.tar.bz2
jellything-a491792196c034efbd2f8998944af3f7958c0e52.tar.zst
Merge branch 'master' of codeberg.org:metamuffin/jellything
Diffstat (limited to 'base/src/lib.rs')
-rw-r--r--base/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/base/src/lib.rs b/base/src/lib.rs
index 132fd45..cfc5a11 100644
--- a/base/src/lib.rs
+++ b/base/src/lib.rs
@@ -5,6 +5,7 @@
*/
#![feature(lazy_cell)]
pub mod cache;
+pub mod database;
pub mod permission;
pub mod temp;
@@ -13,11 +14,11 @@ 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()