fix(core): clear env args on restart test

This commit is contained in:
Lucas Nogueira
2022-07-25 19:17:32 -03:00
parent 816f474c3e
commit f7ea867d31

View File

@@ -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 => {}
};