mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-06 22:26:59 +02:00
fix: fix plugins/fs infinite loop on autoregen (#1029)
* Created safety check for redundant autogenerations * Accounted for empty file case, added .changes file * Update plugins/fs/build.rs
This commit is contained in:
1 parent
ac520a2841
commit
735810237e
2 files changed
+11
-2
No files matched your search
+5
-2
@@ -154,8 +154,11 @@ permissions = [
|
||||
]"###
|
||||
);
|
||||
|
||||
std::fs::write(base_dirs.join(format!("{lower}.toml")), toml)
|
||||
.unwrap_or_else(|e| panic!("unable to autogenerate ${upper}: {e}"));
|
||||
let permission_path = base_dirs.join(format!("{lower}.toml"));
|
||||
if toml != std::fs::read_to_string(&permission_path).unwrap_or_default() {
|
||||
std::fs::write(permission_path, toml)
|
||||
.unwrap_or_else(|e| panic!("unable to autogenerate ${lower}: {e}"));
|
||||
}
|
||||
}
|
||||
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
|
||||
Reference in new issue
Block a user