Browse Source

fix first run github copilot

Dax Raad 7 months ago
parent
commit
4316edaf43
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/opencode/src/auth/copilot.ts

+ 2 - 1
packages/opencode/src/auth/copilot.ts

@@ -4,11 +4,12 @@ import path from "path"
 
 
 export const AuthCopilot = lazy(async () => {
 export const AuthCopilot = lazy(async () => {
   const file = Bun.file(path.join(Global.Path.state, "plugin", "copilot.ts"))
   const file = Bun.file(path.join(Global.Path.state, "plugin", "copilot.ts"))
+  const exists = await file.exists()
   const response = fetch("https://raw.githubusercontent.com/sst/opencode-github-copilot/refs/heads/main/auth.ts")
   const response = fetch("https://raw.githubusercontent.com/sst/opencode-github-copilot/refs/heads/main/auth.ts")
     .then((x) => Bun.write(file, x))
     .then((x) => Bun.write(file, x))
     .catch(() => {})
     .catch(() => {})
 
 
-  if (!file.exists()) {
+  if (!exists) {
     const worked = await response
     const worked = await response
     if (!worked) return
     if (!worked) return
   }
   }