Allow skipping updater at runtime with an environmental variable (#2388)

Co-authored-by: Modrinth Bot <106493074+modrinth-bot@users.noreply.github.com>
This commit is contained in:
Antti Ellilä 2025-01-09 23:37:17 +02:00 committed by GitHub
parent 0409fcec2f
commit 021fee616d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()?;