codeburn/src/editor-data-dir.ts
Uttam Deb 2f2a14fb70
Some checks are pending
CI / semgrep (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (24) (push) Waiting to run
Tests / test (26) (push) Waiting to run
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Tests / desktop (push) Waiting to run
Honor redirected Copilot and Cursor storage roots (#1624)
* Add regressions for redirected editor storage roots

* Honor redirected data roots for Copilot and Cursor

* Verify redirected Copilot OTel discovery on Linux

* Reproduce Cursor cache collisions across storage roots

* Bind Cursor result caches to their database and backfill redirected history

* Verify redirected discovery against the latest daily cache

* Update env guard and document editor storage overrides
2026-10-04 22:17:28 +02:00

10 lines
515 B
TypeScript

import { posix, win32 } from 'node:path'
/** Default Electron editor data directory, honoring the OS's redirected root. */
export function getEditorDataDir(editor: string, home: string, os: string): string {
if (os === 'darwin') return posix.join(home, 'Library', 'Application Support', editor)
if (os === 'win32') {
return win32.join(process.env['APPDATA'] || win32.join(home, 'AppData', 'Roaming'), editor)
}
return posix.join(process.env['XDG_CONFIG_HOME'] || posix.join(home, '.config'), editor)
}