mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
fix(scheduler) fn type
This commit is contained in:
11 files changed
+103
-10
No files matched your search
@@ -0,0 +1,24 @@
|
||||
use dirs::home_dir;
|
||||
use std::env;
|
||||
|
||||
pub fn task() {
|
||||
// get dir
|
||||
let git_work_dir_path = &env::var("GIT_WORK_DIR").unwrap_or_else(|e| {
|
||||
if let Ok(default_log_path) = env::var("WORK_DIR") {
|
||||
if default_log_path.starts_with('~') {
|
||||
let home_path = home_dir().unwrap_or_else(|| panic!("Cannot find home directory"));
|
||||
home_path
|
||||
.join(default_log_path.strip_prefix("~/").unwrap())
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.expect(
|
||||
"[fatal] failed to parse env `WORK_DIR`, try to use absolute path instead",
|
||||
)
|
||||
} else {
|
||||
default_log_path
|
||||
}
|
||||
} else {
|
||||
panic!("[fatal] failed to parse env `GIT_WORK_DIR`: {}", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user