Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Mar 23, 2024
1 parent 869a993 commit de900a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { upsertByte } from "../app/lib/api/bytes"

const filenames = await fs.readdir(new URL("../e2e/bytes", import.meta.url))

const promises = filenames.map(async (filename) => {
for await (const filename of filenames) {
const id = filename.replace(".md", "")
const source = await fs.readFile(
new URL(`../e2e/bytes/${filename}`, import.meta.url),
"utf-8",
)

await upsertByte(id, source)
})

await Promise.all(promises)
}

0 comments on commit de900a8

Please sign in to comment.