summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 971f544..17ad6b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,7 +6,7 @@ pub mod db;
6pub mod error; 6pub mod error;
7pub mod files; 7pub mod files;
8 8
9use std::io::{Error, ErrorKind}; 9use std::{io::{Error, ErrorKind}, path::Path};
10 10
11pub use apis::*; 11pub use apis::*;
12pub use commands::*; 12pub use commands::*;
@@ -33,3 +33,17 @@ impl Modloader {
33 } 33 }
34 } 34 }
35} 35}
36
37pub fn devdir(path: &str) -> String {
38 let p = Path::new(path);
39 let dev = std::env::var("DEV");
40 let lvl = match dev {
41 Ok(dev) => dev.parse::<i32>().unwrap(),
42 Err(..) => 0,
43 };
44 if lvl >= 1 {
45 format!("./dev/{}", p.file_name().unwrap().to_str().unwrap())
46 } else {
47 String::from(path)
48 }
49}