瀏覽代碼

chore: generate

opencode-agent[bot] 2 月之前
父節點
當前提交
d5068ba28e
共有 1 個文件被更改,包括 20 次插入17 次删除
  1. 20 17
      packages/opencode/src/installation/index.ts

+ 20 - 17
packages/opencode/src/installation/index.ts

@@ -149,23 +149,26 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
       return `Upgrade failed for ${method}.`
     }
 
-    const upgradeCurl = Effect.fnUntraced(function* (target: string) {
-      const response = yield* httpOk.execute(HttpClientRequest.get("https://opencode.ai/install"))
-      const body = yield* response.text
-      const bodyBytes = new TextEncoder().encode(body)
-      const result = yield* appProcess.run(
-        ChildProcess.make("bash", [], {
-          stdin: Stream.make(bodyBytes),
-          env: { VERSION: target },
-          extendEnv: true,
-        }),
-      )
-      return {
-        code: result.exitCode,
-        stdout: result.stdout.toString("utf8"),
-        stderr: result.stderr.toString("utf8"),
-      }
-    }, Effect.mapError(() => new UpgradeFailedError({ stderr: upgradeFailure("curl") })))
+    const upgradeCurl = Effect.fnUntraced(
+      function* (target: string) {
+        const response = yield* httpOk.execute(HttpClientRequest.get("https://opencode.ai/install"))
+        const body = yield* response.text
+        const bodyBytes = new TextEncoder().encode(body)
+        const result = yield* appProcess.run(
+          ChildProcess.make("bash", [], {
+            stdin: Stream.make(bodyBytes),
+            env: { VERSION: target },
+            extendEnv: true,
+          }),
+        )
+        return {
+          code: result.exitCode,
+          stdout: result.stdout.toString("utf8"),
+          stderr: result.stderr.toString("utf8"),
+        }
+      },
+      Effect.mapError(() => new UpgradeFailedError({ stderr: upgradeFailure("curl") })),
+    )
 
     const result: Interface = {
       info: Effect.fn("Installation.info")(function* () {