浏览代码

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)?