From 69dcfdfe0f3b0570fcf5997267a7200087d5341b Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 12 Jul 2024 10:13:08 -0300 Subject: [PATCH] fix(build): skip rerun-if-changed when Info.plist do not exist (#10267) --- .changes/info-plist-rerun-if-changed.md | 5 +++++ core/tauri-build/src/codegen/context.rs | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .changes/info-plist-rerun-if-changed.md diff --git a/.changes/info-plist-rerun-if-changed.md b/.changes/info-plist-rerun-if-changed.md new file mode 100644 index 000000000..736cdee41 --- /dev/null +++ b/.changes/info-plist-rerun-if-changed.md @@ -0,0 +1,5 @@ +--- +"tauri-build": patch:bug +--- + +Fix build script rerun-if-changed instruction if Info.plist do not exist next to tauri.conf.json. diff --git a/core/tauri-build/src/codegen/context.rs b/core/tauri-build/src/codegen/context.rs index f003523ad..224857e10 100644 --- a/core/tauri-build/src/codegen/context.rs +++ b/core/tauri-build/src/codegen/context.rs @@ -115,10 +115,12 @@ impl CodegenContext { } #[cfg(target_os = "macos")] - println!( - "cargo:rerun-if-changed={}", - config_parent.join("Info.plist").display() - ); + { + let info_plist_path = config_parent.join("Info.plist"); + if info_plist_path.exists() { + println!("cargo:rerun-if-changed={}", info_plist_path.display()); + } + } let code = context_codegen(ContextData { dev: crate::is_dev(),