Skip to content

Commit

Permalink
WIP: Try windows path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coderofstuff committed Dec 9, 2023
1 parent f8fea02 commit f577d5c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions kaspad/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,16 @@ pub struct Runtime {
/// This function can be used to identify the location of
/// the application folder that contains kaspad logs and the database.
pub fn get_app_dir_from_args(args: &Args) -> PathBuf {
let app_dir = args
let mut app_dir = args
.appdir
.clone()
.unwrap_or_else(|| get_app_dir().as_path().to_str().unwrap().to_string())
.replace('~', get_home_dir().as_path().to_str().unwrap());
.unwrap_or_else(|| get_app_dir().as_path().to_str().unwrap().to_string());

#[cfg(any(target_os = "macos", target_os = "linux"))]
{
app_dir = app_dir.replace('~', get_home_dir().as_path().to_str().unwrap());
}

if app_dir.is_empty() {
get_app_dir()
} else {
Expand Down

0 comments on commit f577d5c

Please sign in to comment.