Skip to content

Commit 06fe87b

Browse files
committed
fix failing migration
1 parent 944fda4 commit 06fe87b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/opencode/src/storage/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export namespace Storage {
2323
const MIGRATIONS: Migration[] = [
2424
async (dir) => {
2525
const project = path.resolve(dir, "../project")
26+
if (!fs.exists(project)) return
2627
for await (const projectDir of new Bun.Glob("*").scan({
2728
cwd: project,
2829
onlyFiles: false,
@@ -177,8 +178,7 @@ export namespace Storage {
177178

178179
async function withErrorHandling<T>(body: () => Promise<T>) {
179180
return body().catch((e) => {
180-
if (!(e instanceof Error))
181-
throw e
181+
if (!(e instanceof Error)) throw e
182182
const errnoException = e as NodeJS.ErrnoException
183183
if (errnoException.code === "ENOENT") {
184184
throw new NotFoundError({ message: `Resource not found: ${errnoException.path}` })

0 commit comments

Comments
 (0)