core: fix storage directory existence check during json migration
Use fs.existsSync() instead of Bun.file().exists() since we're checking for a directory, not a file.
This commit is contained in:
parent
794ecab028
commit
ed87341c4f
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import { ProjectTable } from "../project/project.sql"
|
||||||
import { SessionTable, MessageTable, PartTable, TodoTable, PermissionTable } from "../session/session.sql"
|
import { SessionTable, MessageTable, PartTable, TodoTable, PermissionTable } from "../session/session.sql"
|
||||||
import { SessionShareTable } from "../share/share.sql"
|
import { SessionShareTable } from "../share/share.sql"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
|
import { existsSync } from "fs"
|
||||||
|
|
||||||
export namespace JsonMigration {
|
export namespace JsonMigration {
|
||||||
const log = Log.create({ service: "json-migration" })
|
const log = Log.create({ service: "json-migration" })
|
||||||
|
|
@ -13,7 +14,7 @@ export namespace JsonMigration {
|
||||||
export async function run(sqlite: Database) {
|
export async function run(sqlite: Database) {
|
||||||
const storageDir = path.join(Global.Path.data, "storage")
|
const storageDir = path.join(Global.Path.data, "storage")
|
||||||
|
|
||||||
if (!(await Bun.file(storageDir).exists())) {
|
if (!existsSync(storageDir)) {
|
||||||
log.info("storage directory does not exist, skipping migration")
|
log.info("storage directory does not exist, skipping migration")
|
||||||
return {
|
return {
|
||||||
projects: 0,
|
projects: 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue