diff --git a/.changes/fix-linux-resource-path.md b/.changes/fix-linux-resource-path.md new file mode 100644 index 000000000..7b684afd5 --- /dev/null +++ b/.changes/fix-linux-resource-path.md @@ -0,0 +1,6 @@ +--- +"tauri-utils": patch +"tauri": patch +--- + +Fixes resource directory resolution on Linux. diff --git a/core/tauri-utils/Cargo.toml b/core/tauri-utils/Cargo.toml index 0b52661d2..bdb11e316 100644 --- a/core/tauri-utils/Cargo.toml +++ b/core/tauri-utils/Cargo.toml @@ -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" ] diff --git a/core/tauri-utils/src/lib.rs b/core/tauri-utils/src/lib.rs index 405c41570..74e2bda45 100644 --- a/core/tauri-utils/src/lib.rs +++ b/core/tauri-utils/src/lib.rs @@ -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() } } diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index fbf861b7c..3626e816a 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -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",