mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:03:45 +08:00
chore: remove compatibility code
This commit is contained in:
parent
c3cba03ac6
commit
9591fb2c21
@ -137,7 +137,10 @@ pub async fn install_service(passwd: String) -> Result<()> {
|
|||||||
.output()?;
|
.output()?;
|
||||||
let output = sudo(
|
let output = sudo(
|
||||||
&passwd,
|
&passwd,
|
||||||
installer_path.to_string_lossy().replace(" ", "\\ ").to_string(),
|
installer_path
|
||||||
|
.to_string_lossy()
|
||||||
|
.replace(" ", "\\ ")
|
||||||
|
.to_string(),
|
||||||
)
|
)
|
||||||
.output()?;
|
.output()?;
|
||||||
|
|
||||||
@ -244,7 +247,10 @@ pub async fn uninstall_service(passwd: String) -> Result<()> {
|
|||||||
.output()?;
|
.output()?;
|
||||||
let output = sudo(
|
let output = sudo(
|
||||||
&passwd,
|
&passwd,
|
||||||
uninstaller_path.to_string_lossy().replace(" ", "\\ ").to_string(),
|
uninstaller_path
|
||||||
|
.to_string_lossy()
|
||||||
|
.replace(" ", "\\ ")
|
||||||
|
.to_string(),
|
||||||
)
|
)
|
||||||
.output()?;
|
.output()?;
|
||||||
|
|
||||||
@ -285,21 +291,7 @@ pub(super) async fn run_core_by_service(config_file: &PathBuf) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let clash_core = { Config::verge().latest().clash_core.clone() };
|
let clash_core = { Config::verge().latest().clash_core.clone() };
|
||||||
let mut clash_core = clash_core.unwrap_or("verge-mihomo".into());
|
let clash_core = clash_core.unwrap_or("verge-mihomo".into());
|
||||||
|
|
||||||
// compatibility
|
|
||||||
if clash_core.contains("clash") {
|
|
||||||
clash_core = "verge-mihomo".to_string();
|
|
||||||
Config::verge().draft().patch_config(IVerge {
|
|
||||||
clash_core: Some("verge-mihomo".to_string()),
|
|
||||||
..IVerge::default()
|
|
||||||
});
|
|
||||||
Config::verge().apply();
|
|
||||||
match Config::verge().data().save_file() {
|
|
||||||
Ok(_) => handle::Handle::refresh_verge(),
|
|
||||||
Err(err) => log::error!(target: "app", "{err}"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let bin_ext = if cfg!(windows) { ".exe" } else { "" };
|
let bin_ext = if cfg!(windows) { ".exe" } else { "" };
|
||||||
let clash_bin = format!("{clash_core}{bin_ext}");
|
let clash_bin = format!("{clash_core}{bin_ext}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user