refactor(shared): consolidate 13+ getMessageDir copies into single shared function
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { existsSync, readdirSync } from "node:fs"
|
||||
import { join } from "node:path"
|
||||
import { MESSAGE_STORAGE } from "../tools/session-manager/constants"
|
||||
import { getOpenCodeStorageDir } from "./data-path"
|
||||
|
||||
const MESSAGE_STORAGE = join(getOpenCodeStorageDir(), "message")
|
||||
|
||||
export function getMessageDir(sessionID: string): string | null {
|
||||
if (!sessionID.startsWith("ses_")) return null
|
||||
if (!existsSync(MESSAGE_STORAGE)) return null
|
||||
|
||||
const directPath = join(MESSAGE_STORAGE, sessionID)
|
||||
|
||||
Reference in New Issue
Block a user