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