From 021fee616dcd92dad54677bc526b19c5ee51fa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Ellil=C3=A4?= Date: Thu, 9 Jan 2025 23:37:17 +0200 Subject: [PATCH] Allow skipping updater at runtime with an environmental variable (#2388) Co-authored-by: Modrinth Bot <106493074+modrinth-bot@users.noreply.github.com> --- apps/app/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/app/src/main.rs b/apps/app/src/main.rs index 402f3c8cc..f313bb9a3 100644 --- a/apps/app/src/main.rs +++ b/apps/app/src/main.rs @@ -4,6 +4,7 @@ )] use native_dialog::{MessageDialog, MessageType}; +use std::env; use tauri::{Listener, Manager}; use theseus::prelude::*; @@ -29,7 +30,12 @@ async fn initialize_state(app: tauri::AppHandle) -> api::Result<()> { theseus::EventState::init(app.clone()).await?; #[cfg(feature = "updater")] - { + 'updater: { + if env::var("MODRINTH_EXTERNAL_UPDATE_PROVIDER").is_ok() { + State::init().await?; + break 'updater; + } + use tauri_plugin_updater::UpdaterExt; let updater = app.updater_builder().build()?;