Skip to content

Commit

Permalink
enhance: always check parent directory (fix tauri-apps#8679) (tauri-a…
Browse files Browse the repository at this point in the history
…pps#11429)

* enhance: always check parent directory (fix tauri-apps#8679)

* Update crates/tauri-utils/src/platform.rs

* add change file

* fix crate

---------

Co-authored-by: Lucas Fernandes Nogueira <[email protected]>
  • Loading branch information
2 people authored and Mariela Sassi committed Dec 12, 2024
1 parent 7c16d0f commit 3729339
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changes/enhance-resource-dir-linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-utils": patch:bug
---

Enhance resource directory resolution to support running on distros like NixOS.
12 changes: 6 additions & 6 deletions core/tauri-utils/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<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.package_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.package_name()))
.canonicalize()
{
Ok(bundle_dir)
} else if let Some(appdir) = &env.appdir {
let appdir: &std::path::Path = appdir.as_ref();
Ok(PathBuf::from(format!(
Expand Down

0 comments on commit 3729339

Please sign in to comment.