From 21bef69e1d76e90f0dea97197a5c5f102354e0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Ellil=C3=A4?= Date: Tue, 10 Sep 2024 20:04:52 +0300 Subject: [PATCH] Allow skipping updater at runtime with an environmental variable --- 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 8f97fcd70..6c57568d2 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::*; @@ -28,7 +29,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()?;