fix the updater (#2250)

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-04-25 12:41:22 -07:00
committed by GitHub
parent 755ef8ce7f
commit 005944f3a3

View File

@ -352,17 +352,6 @@ fn show_in_folder(path: &str) -> Result<(), InvokeError> {
fn main() -> Result<()> {
tauri::Builder::default()
.setup(|_app| {
#[cfg(debug_assertions)]
{
_app.get_webview("main").unwrap().open_devtools();
}
#[cfg(not(debug_assertions))]
{
_app.handle().plugin(tauri_plugin_updater::Builder::new().build())?;
}
Ok(())
})
.invoke_handler(tauri::generate_handler![
get_state,
set_state,
@ -383,6 +372,16 @@ fn main() -> Result<()> {
])
.plugin(tauri_plugin_cli::init())
.setup(|app| {
// Do update things.
#[cfg(debug_assertions)]
{
app.get_webview("main").unwrap().open_devtools();
}
#[cfg(not(debug_assertions))]
{
app.handle().plugin(tauri_plugin_updater::Builder::new().build())?;
}
let mut verbose = false;
let mut source_path: Option<PathBuf> = None;
match app.cli().matches() {