Dax Raad 8 месяцев назад
Родитель
Сommit
6ed661c140
3 измененных файлов с 18 добавлено и 17 удалено
  1. 1 1
      .github/workflows/deploy.yml
  2. 1 1
      .github/workflows/publish.yml
  3. 16 15
      packages/opencode/src/index.ts

+ 1 - 1
.github/workflows/deploy.yml

@@ -17,7 +17,7 @@ jobs:
 
       - uses: oven-sh/setup-bun@v1
         with:
-          bun-version: latest
+          bun-version: 1.2.17
 
       - run: bun install
 

+ 1 - 1
.github/workflows/publish.yml

@@ -32,7 +32,7 @@ jobs:
 
       - uses: oven-sh/setup-bun@v2
         with:
-          bun-version: 1.2.16
+          bun-version: 1.2.17
 
       - name: Install makepkg
         run: |

+ 16 - 15
packages/opencode/src/index.ts

@@ -92,21 +92,22 @@ const cli = yargs(hideBin(process.argv))
             },
           })
 
-            ; (async () => {
-              if (Installation.VERSION === "dev") return
-              if (Installation.isSnapshot()) return
-              const config = await Config.global()
-              if (config.autoupdate === false) return
-              const latest = await Installation.latest()
-              if (Installation.VERSION === latest) return
-              const method = await Installation.method()
-              if (method === "unknown") return
-              await Installation.upgrade(method, latest)
-                .then(() => {
-                  Bus.publish(Installation.Event.Updated, { version: latest })
-                })
-                .catch(() => { })
-            })()
+          ;(async () => {
+            if (Installation.VERSION === "dev") return
+            if (Installation.isSnapshot()) return
+            const config = await Config.global()
+            if (config.autoupdate === false) return
+            const latest = await Installation.latest().catch(() => {})
+            if (!latest) return
+            if (Installation.VERSION === latest) return
+            const method = await Installation.method()
+            if (method === "unknown") return
+            await Installation.upgrade(method, latest)
+              .then(() => {
+                Bus.publish(Installation.Event.Updated, { version: latest })
+              })
+              .catch(() => {})
+          })()
 
           await proc.exited
           server.stop()