fix(core): resource path resolution on Linux, closes #2493

This commit is contained in:
Lucas Nogueira
2021-08-22 20:41:26 -03:00
parent 994b5325dd
commit 1a28904b8e
4 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"tauri-utils": patch
"tauri": patch
---
Fixes resource directory resolution on Linux.

View File

@@ -22,5 +22,8 @@ html5ever = "0.25"
proc-macro2 = { version = "1.0", optional = true }
quote = { version = "1.0", optional = true }
[target."cfg(target_os = \"linux\")".dependencies]
heck = "0.3"
[features]
build = [ "proc-macro2", "quote" ]

View File

@@ -23,6 +23,12 @@ impl PackageInfo {
/// Returns the application package name.
/// On macOS and Windows it's the `name` field, and on Linux it's the `name` in `kebab-case`.
pub fn package_name(&self) -> String {
#[cfg(target_os = "linux")]
{
use heck::KebabCase;
self.name.clone().to_kebab_case()
}
#[cfg(not(target_os = "linux"))]
self.name.clone()
}
}

View File

@@ -2898,7 +2898,7 @@ dependencies = [
[[package]]
name = "tauri"
version = "1.0.0-beta.6"
version = "1.0.0-beta.7"
dependencies = [
"attohttpc",
"base64",
@@ -3038,6 +3038,7 @@ dependencies = [
name = "tauri-utils"
version = "1.0.0-beta.3"
dependencies = [
"heck",
"html5ever",
"kuchiki",
"phf 0.10.0",