Skip to content

Commit

Permalink
Resolve application symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Nov 19, 2023
1 parent 6509dd5 commit 376e8b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ fn main() -> ExitCode {

//Setup paths
let install_dir = if !cfg!(feature="testapp") {
PathBuf::from(std::env::current_exe().unwrap().parent().unwrap())
let mut exe_path = std::env::current_exe().unwrap();
if std::fs::metadata(&exe_path).unwrap().is_symlink() {
exe_path = std::fs::read_link(&exe_path).unwrap();
}

PathBuf::from(exe_path.parent().unwrap())
} else {
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("test");
Expand Down

0 comments on commit 376e8b9

Please sign in to comment.