Skip to content

Commit

Permalink
fix(cli): clear plugin JSON file before rebuilding (#6881)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed May 6, 2023
1 parent 7a4b1fb commit 6d1fa49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/fix-plugin-removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---

Clear Android plugin JSON file before building Rust library to ensure removed plugins are propagated to the Android project.
3 changes: 2 additions & 1 deletion tooling/cli/src/mobile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::{
env::{set_var, temp_dir},
ffi::OsString,
fmt::Write,
fs::{create_dir_all, read_to_string, write},
fs::{create_dir_all, read_to_string, remove_file, write},
net::SocketAddr,
path::PathBuf,
process::{exit, ExitStatus},
Expand Down Expand Up @@ -318,6 +318,7 @@ fn ensure_init(project_dir: PathBuf, target: Target) -> Result<()> {
} else {
if target == Target::Android {
create_dir_all(project_dir.join(".tauri"))?;
let _ = remove_file(project_dir.join(".tauri").join("plugins.json"));
}
Ok(())
}
Expand Down

0 comments on commit 6d1fa49

Please sign in to comment.