Skip to content

Commit 81f5d8d

Browse files
authored
fix(exit): Properly hangup weidu process (#178)
2 parents 41e05ee + f04f150 commit 81f5d8d

File tree

2 files changed

+67
-51
lines changed

2 files changed

+67
-51
lines changed

Cargo.lock

Lines changed: 54 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/weidu.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ use crate::{
1919
};
2020

2121
fn generate_args(weidu_mod: &Component, weidu_log_mode: &str, language: &str) -> Vec<String> {
22-
format!("{mod_name}/{mod_tp_file} {weidu_log_mode} --force-install {component} --use-lang {game_lang} --language {mod_lang}",
23-
mod_name = weidu_mod.name,
24-
mod_tp_file = weidu_mod.tp_file,
25-
weidu_log_mode = weidu_log_mode,
26-
component = weidu_mod.component,
27-
mod_lang = weidu_mod.lang,
28-
game_lang = language
29-
)
30-
.split(' ')
31-
.map(|x|x.to_string())
32-
.collect()
22+
let mod_name = &weidu_mod.name;
23+
let mod_tp_file = &weidu_mod.tp_file;
24+
vec![
25+
format!("{mod_name}/{mod_tp_file}"),
26+
weidu_log_mode.to_string(),
27+
"--force-install".to_string(),
28+
weidu_mod.component.to_string(),
29+
"--use-lang".to_string(),
30+
language.to_string(),
31+
"--language".to_string(),
32+
weidu_mod.lang.to_string(),
33+
"--no-exit-pause".to_string(),
34+
]
3335
}
3436

3537
pub(crate) enum InstallationResult {

0 commit comments

Comments
 (0)