Skip to content

Commit

Permalink
fix resource_dir() on windows
Browse files Browse the repository at this point in the history
due to rust feature on windows rust-lang/rust#99931 use dunce::canonicalize() to get proper name
  • Loading branch information
olexiyb committed Jun 19, 2024
1 parent 081449d commit fffeb13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions core/tauri-utils/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ mod tests {

use crate::{Env, PackageInfo};

#[test]
fn test_current_exe() {
let current = super::current_exe().unwrap();
let current_expected = std::env::current_exe().unwrap();
assert_eq!(current, current_expected);
}

#[test]
fn resolve_resource_dir() {
let package_info = PackageInfo {
Expand Down
2 changes: 1 addition & 1 deletion core/tauri-utils/src/platform/starting_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl StartingBinary {
}

// we canonicalize the path to resolve any symlinks to the real exe path
Self(dangerous_path.canonicalize())
Self(dunce::canonicalize(dangerous_path))
}

/// A clone of the [`PathBuf`] found to be the starting path.
Expand Down

0 comments on commit fffeb13

Please sign in to comment.