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

This commit is contained in:
Lucas Nogueira 2022-06-15 09:03:53 -03:00
parent dc432ef8b0
commit 562e8ca23f
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1
2 changed files with 6 additions and 1 deletions

View File

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

View File

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