Explorar o código

fix(core): clear env args on restart test

Lucas Nogueira %!s(int64=3) %!d(string=hai) anos
pai
achega
f7ea867d31
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      core/tests/restart/src/main.rs

+ 7 - 1
core/tests/restart/src/main.rs

@@ -2,6 +2,8 @@
 // SPDX-License-Identifier: Apache-2.0
 // SPDX-License-Identifier: MIT
 
+use tauri::Env;
+
 fn main() {
   let mut argv = std::env::args();
   let argc = argv.len();
@@ -17,7 +19,11 @@ fn main() {
   );
 
   match argv.nth(1).as_deref() {
-    Some("restart") => tauri::api::process::restart(&Default::default()),
+    Some("restart") => {
+      let mut env = Env::default();
+      env.args.clear();
+      tauri::api::process::restart(&env)
+    }
     Some(invalid) => panic!("only argument `restart` is allowed, {} is invalid", invalid),
     None => {}
   };