Skip to content

Commit 3781429

Browse files
enhance: always check parent directory (fix #8679) (#11429)
* enhance: always check parent directory (fix #8679) * Update crates/tauri-utils/src/platform.rs * add change file * fix crate --------- Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
1 parent 15d6515 commit 3781429

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-utils": patch:bug
3+
---
4+
5+
Enhance resource directory resolution to support running on distros like NixOS.

crates/tauri-utils/src/platform.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,12 @@ fn resource_dir_from<P: AsRef<std::path::Path>>(
309309

310310
#[cfg(target_os = "linux")]
311311
{
312-
res = if curr_dir.ends_with("/data/usr/bin") {
313-
// running from the deb bundle dir
314-
exe_dir
315-
.join(format!("../lib/{}", package_info.name))
316-
.canonicalize()
317-
.map_err(Into::into)
312+
// (canonicalize checks for existence, so there's no need for an extra check)
313+
res = if let Ok(bundle_dir) = exe_dir
314+
.join(format!("../lib/{}", package_info.name))
315+
.canonicalize()
316+
{
317+
Ok(bundle_dir)
318318
} else if let Some(appdir) = &env.appdir {
319319
let appdir: &std::path::Path = appdir.as_ref();
320320
Ok(PathBuf::from(format!(

0 commit comments

Comments
 (0)