summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorfx <[email protected]>2023-04-27 10:10:03 +0200
committerfx <[email protected]>2023-04-27 10:10:03 +0200
commit43ca5fec20933fc31dfe7d7dbd1f1b9258612219 (patch)
treeeef58fecfadad90386b38af581abab8cc3d3cfc0 /src/lib.rs
parent4300ad2eb05dddfa4274e04b204f2ad28c87da05 (diff)
parent4e6466af1329f7b9e341df2e76ab696d11f80c93 (diff)
downloadmodlist-43ca5fec20933fc31dfe7d7dbd1f1b9258612219.tar
modlist-43ca5fec20933fc31dfe7d7dbd1f1b9258612219.tar.gz
modlist-43ca5fec20933fc31dfe7d7dbd1f1b9258612219.zip
Merge pull request 'cache' (#3) from cache into master
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/3
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 43f0fe7..185edd7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,11 +1,12 @@
1pub mod apis; 1pub mod apis;
2pub mod cache;
2pub mod commands; 3pub mod commands;
3pub mod config; 4pub mod config;
4pub mod db; 5pub mod db;
5pub mod error; 6pub mod error;
6pub mod files; 7pub mod files;
7 8
8use std::{fmt::Display, path::Path}; 9use std::fmt::Display;
9 10
10pub use apis::*; 11pub use apis::*;
11pub use commands::*; 12pub use commands::*;
@@ -35,17 +36,3 @@ impl Display for Modloader {
35 } 36 }
36 } 37 }
37} 38}
38
39pub fn devdir(path: &str) -> String {
40 let p = Path::new(path);
41 let dev = std::env::var("DEV");
42 let lvl = match dev {
43 Ok(dev) => dev.parse::<i32>().unwrap(),
44 Err(..) => 0,
45 };
46 if lvl >= 1 {
47 format!("./dev/{}", p.file_name().unwrap().to_str().unwrap())
48 } else {
49 String::from(path)
50 }
51}