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>
This commit is contained in:
griffi-gh
2024-11-06 16:41:13 +03:00
committed by GitHub
parent 15d6515eb1
commit 3781429147
2 changed files with 11 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri-utils": patch:bug
---
Enhance resource directory resolution to support running on distros like NixOS.

View File

@@ -309,12 +309,12 @@ fn resource_dir_from<P: AsRef<std::path::Path>>(
#[cfg(target_os = "linux")]
{
res = if curr_dir.ends_with("/data/usr/bin") {
// running from the deb bundle dir
exe_dir
.join(format!("../lib/{}", package_info.name))
.canonicalize()
.map_err(Into::into)
// (canonicalize checks for existence, so there's no need for an extra check)
res = if let Ok(bundle_dir) = exe_dir
.join(format!("../lib/{}", package_info.name))
.canonicalize()
{
Ok(bundle_dir)
} else if let Some(appdir) = &env.appdir {
let appdir: &std::path::Path = appdir.as_ref();
Ok(PathBuf::from(format!(