Skip to content

Commit 88c0ad9

Browse files
authored
fix(build): check if permissions dir exists before adding cargo:rerun-if-changed (#9471)
closes #9062
1 parent daf018e commit 88c0ad9

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-build": "patch:bug"
3+
---
4+
5+
Fix tauri always rebuilding even if source code didn't change.
6+

core/tauri-build/src/acl.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,12 @@ pub fn inline_plugins(
360360
)?);
361361
} else {
362362
let default_permissions_path = Path::new("permissions").join(name);
363-
println!(
364-
"cargo:rerun-if-changed={}",
365-
default_permissions_path.display()
366-
);
363+
if default_permissions_path.exists() {
364+
println!(
365+
"cargo:rerun-if-changed={}",
366+
default_permissions_path.display()
367+
);
368+
}
367369
permission_files.extend(tauri_utils::acl::build::define_permissions(
368370
&default_permissions_path
369371
.join("**")
@@ -418,10 +420,12 @@ pub fn app_manifest_permissions(
418420
)?);
419421
} else {
420422
let default_permissions_path = Path::new("permissions");
421-
println!(
422-
"cargo:rerun-if-changed={}",
423-
default_permissions_path.display()
424-
);
423+
if default_permissions_path.exists() {
424+
println!(
425+
"cargo:rerun-if-changed={}",
426+
default_permissions_path.display()
427+
);
428+
}
425429

426430
let permissions_root = current_dir()?.join("permissions");
427431
let inlined_plugins_permissions: Vec<_> = inlined_plugins

0 commit comments

Comments
 (0)