Преглед изворни кода

fix(codegen): tray icon path is relative to the config directory

Lucas Nogueira пре 3 година
родитељ
комит
562e8ca23f
2 измењених фајлова са 6 додато и 1 уклоњено
  1. 5 0
      .changes/fix-tray-icon-lookup.md
  2. 1 1
      core/tauri-codegen/src/context.rs

+ 5 - 0
.changes/fix-tray-icon-lookup.md

@@ -0,0 +1,5 @@
+---
+"tauri-codegen": patch
+---
+
+Read the tray icon path relatively to the config directory.

+ 1 - 1
core/tauri-codegen/src/context.rs

@@ -242,7 +242,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
   );
 
   let system_tray_icon = if let Some(tray) = &config.tauri.system_tray {
-    let system_tray_icon_path = tray.icon_path.clone();
+    let system_tray_icon_path = config_parent.join(&tray.icon_path);
     let ext = system_tray_icon_path.extension();
     if ext.map_or(false, |e| e == "ico") {
       ico_icon(&root, &out_dir, system_tray_icon_path)?