MCPcopy
hub / github.com/NitroRCr/AIaW / tauriUpdate

Function tauriUpdate

src/utils/update.ts:78–113  ·  view source on GitHub ↗
(latest: Version, force: boolean)

Source from the content-addressed store, hash-verified

76}
77
78async function tauriUpdate(latest: Version, force: boolean) {
79 const isDeb = TauriPlatform === 'linux' && await invoke('is_deb_package')
80 const update = await check(isDeb ? { target: 'linux-deb' } : {})
81 if (!update) return
82 if (TauriPlatform === 'windows' || isDeb) {
83 if (force && !isUpdateIgnored(latest.version)) {
84 await update.download()
85 wrapNotify(
86 t('update.downloadedNewVersion', { version: latest.version }),
87 [{
88 label: t('update.ignore'),
89 handler: () => {
90 ignoreUpdate(latest.version)
91 }
92 }, {
93 label: t('update.install'),
94 handler: async () => {
95 await update.install()
96 await relaunch()
97 }
98 }]
99 )
100 }
101 } else {
102 await update.downloadAndInstall()
103 force && wrapNotify(
104 t('update.installedNewVersion', { version: latest.version }),
105 [{
106 label: t('update.relaunch'),
107 handler: () => {
108 relaunch()
109 }
110 }]
111 )
112 }
113}
114
115async function ready() {
116 IsCapacitor && await LiveUpdate.ready()

Callers 1

checkUpdateFunction · 0.85

Calls 3

isUpdateIgnoredFunction · 0.85
wrapNotifyFunction · 0.85
ignoreUpdateFunction · 0.85

Tested by

no test coverage detected