Skip to content

Commit 1a28904

Browse files
committed
fix(core): resource path resolution on Linux, closes #2493
1 parent 994b532 commit 1a28904

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-utils": patch
3+
"tauri": patch
4+
---
5+
6+
Fixes resource directory resolution on Linux.

core/tauri-utils/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ html5ever = "0.25"
2222
proc-macro2 = { version = "1.0", optional = true }
2323
quote = { version = "1.0", optional = true }
2424

25+
[target."cfg(target_os = \"linux\")".dependencies]
26+
heck = "0.3"
27+
2528
[features]
2629
build = [ "proc-macro2", "quote" ]

core/tauri-utils/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ impl PackageInfo {
2323
/// Returns the application package name.
2424
/// On macOS and Windows it's the `name` field, and on Linux it's the `name` in `kebab-case`.
2525
pub fn package_name(&self) -> String {
26+
#[cfg(target_os = "linux")]
27+
{
28+
use heck::KebabCase;
29+
self.name.clone().to_kebab_case()
30+
}
31+
#[cfg(not(target_os = "linux"))]
2632
self.name.clone()
2733
}
2834
}

examples/api/src-tauri/Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)