Parcourir la source

feat(storage): ensure storage directory exists and handle paths correctly (#771)

Rami Chowdhury il y a 7 mois
Parent
commit
2d8b90a6ff
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      packages/opencode/src/storage/storage.ts

+ 2 - 1
packages/opencode/src/storage/storage.ts

@@ -39,7 +39,8 @@ export namespace Storage {
 
 
   const state = App.state("storage", async () => {
   const state = App.state("storage", async () => {
     const app = App.info()
     const app = App.info()
-    const dir = path.join(app.path.data, "storage")
+    const dir = path.normalize(path.join(app.path.data, "storage"))
+    await fs.mkdir(dir, { recursive: true })
     const migration = await Bun.file(path.join(dir, "migration"))
     const migration = await Bun.file(path.join(dir, "migration"))
       .json()
       .json()
       .then((x) => parseInt(x))
       .then((x) => parseInt(x))