Skip to content

Commit 29191fe

Browse files
committed
fix: respect XDG_DATA_HOME in state persistence storage path
STORAGE_DIR in persistence.ts also hardcoded ~/.local/share instead of checking XDG_DATA_HOME. Same pattern as the logger fix.
1 parent b4f8765 commit 29191fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/state/persistence.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export interface PersistedSessionState {
2525
lastUpdated: string
2626
}
2727

28-
const STORAGE_DIR = join(homedir(), ".local", "share", "opencode", "storage", "plugin", "dcp")
28+
const STORAGE_DIR = join(
29+
process.env.XDG_DATA_HOME || join(homedir(), ".local", "share"),
30+
"opencode",
31+
"storage",
32+
"plugin",
33+
"dcp",
34+
)
2935

3036
async function ensureStorageDir(): Promise<void> {
3137
if (!existsSync(STORAGE_DIR)) {

0 commit comments

Comments
 (0)