diff options
| author | GitHub Action <[email protected]> | 2025-12-09 09:17:36 +0000 |
|---|---|---|
| committer | GitHub Action <[email protected]> | 2025-12-09 09:17:36 +0000 |
| commit | ff6f1abf619d3d02808db7ffded960023d3d9b0e (patch) | |
| tree | cad9970db52fa6b6ba1c2dff4799c7cbd0aba078 /packages/tauri/src/updater.ts | |
| parent | 331278a5be0ff1bd6c484ba28ae60afb4d40e207 (diff) | |
| download | opencode-ff6f1abf619d3d02808db7ffded960023d3d9b0e.tar.gz opencode-ff6f1abf619d3d02808db7ffded960023d3d9b0e.zip | |
chore: format code
Diffstat (limited to 'packages/tauri/src/updater.ts')
| -rw-r--r-- | packages/tauri/src/updater.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/tauri/src/updater.ts b/packages/tauri/src/updater.ts index e2bf04743..eff93d8cd 100644 --- a/packages/tauri/src/updater.ts +++ b/packages/tauri/src/updater.ts @@ -1,37 +1,37 @@ -import { check, DownloadEvent } from '@tauri-apps/plugin-updater'; -import { relaunch } from '@tauri-apps/plugin-process'; -import { ask, message } from '@tauri-apps/plugin-dialog'; +import { check, DownloadEvent } from "@tauri-apps/plugin-updater" +import { relaunch } from "@tauri-apps/plugin-process" +import { ask, message } from "@tauri-apps/plugin-dialog" -export async function runUpdater(onDownloadEvent?:(progress: DownloadEvent) => void) { - let update; +export async function runUpdater(onDownloadEvent?: (progress: DownloadEvent) => void) { + let update try { - update = await check(); + update = await check() } catch { await message("Failed to check for updates") return false } - if (!update) return; - if (update.version <= update.currentVersion) return; + if (!update) return + if (update.version <= update.currentVersion) return try { - await update.download(onDownloadEvent); + await update.download(onDownloadEvent) } catch { return false } const shouldUpdate = await ask(`Version ${update.version} of OpenCode is available, would you like to install it?`) - if (!shouldUpdate) return; + if (!shouldUpdate) return try { - await update.install(); + await update.install() } catch { await message("Failed to install update") return false } - const shouldRestart = await ask("Update installed successfully, would you like to restart OpenCode?"); - if(shouldRestart) await relaunch() + const shouldRestart = await ask("Update installed successfully, would you like to restart OpenCode?") + if (shouldRestart) await relaunch() - return true; + return true } |
