mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
fix: failed to install service on macos
This commit is contained in:
@@ -206,7 +206,7 @@ pub fn init_resources() -> Result<()> {
|
||||
let src_path = res_dir.join(file);
|
||||
let dest_path = app_dir.join(file);
|
||||
let test_dest_path = test_dir.join(file);
|
||||
log::info!(target: "app", "src_path: {src_path:?}, dest_path: {dest_path:?}");
|
||||
log::debug!(target: "app", "src_path: {src_path:?}, dest_path: {dest_path:?}");
|
||||
|
||||
let handle_copy = |dest: &PathBuf| {
|
||||
match fs::copy(&src_path, dest) {
|
||||
|
||||
@@ -54,8 +54,16 @@ pub async fn resolve_setup(app: &mut App) {
|
||||
log_err!(Config::init_config().await);
|
||||
|
||||
if service::check_service().await.is_err() {
|
||||
log_err!(service::reinstall_service().await);
|
||||
std::thread::sleep(std::time::Duration::from_millis(1000));
|
||||
match service::reinstall_service().await {
|
||||
Ok(_) => {
|
||||
log::info!(target:"app", "install service susccess.");
|
||||
std::thread::sleep(std::time::Duration::from_millis(1000));
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!(target: "app", "{e:?}");
|
||||
app.app_handle().exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log::trace!(target: "app", "launch core");
|
||||
|
||||
Reference in New Issue
Block a user