aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/src/database.rs1
-rw-r--r--base/src/lib.rs12
2 files changed, 7 insertions, 6 deletions
diff --git a/base/src/database.rs b/base/src/database.rs
index b8ba28e..739d292 100644
--- a/base/src/database.rs
+++ b/base/src/database.rs
@@ -10,6 +10,7 @@ use std::path::Path;
use typed_sled::Tree;
pub use sled;
+pub use typed_sled;
pub struct Database {
pub db: sled::Db,
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()