MCPcopy Create free account
hub / github.com/esengine/esengine / checkForUpdates

Function checkForUpdates

packages/editor-app/src/utils/updater.ts:19–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 * 返回检查结果,由调用者决定是否安装
18 */
19export async function checkForUpdates(): Promise<UpdateCheckResult> {
20 try {
21 const update = await check();
22
23 if (update?.available) {
24 pendingUpdate = update;
25 return {
26 available: true,
27 version: update.version,
28 currentVersion: update.currentVersion
29 };
30 } else {
31 pendingUpdate = null;
32 return { available: false };
33 }
34 } catch (error) {
35 console.error('检查更新失败:', error);
36 pendingUpdate = null;
37 return {
38 available: false,
39 error: error instanceof Error ? error.message : '检查更新失败'
40 };
41 }
42}
43
44/**
45 * 安装待处理的更新

Callers 2

handleCheckUpdateFunction · 0.90
checkForUpdatesOnStartupFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected