Ver Fonte

fix(cli): clear plugin JSON file before rebuilding (#6881)

Lucas Fernandes Nogueira há 2 anos atrás
pai
commit
6d1fa49fce
2 ficheiros alterados com 8 adições e 1 exclusões
  1. 6 0
      .changes/fix-plugin-removal.md
  2. 2 1
      tooling/cli/src/mobile/mod.rs

+ 6 - 0
.changes/fix-plugin-removal.md

@@ -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.

+ 2 - 1
tooling/cli/src/mobile/mod.rs

@@ -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},
@@ -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(())
   }