diff --git a/src/main/__tests__/editor-actions.test.ts b/src/main/__tests__/editor-actions.test.ts index 2fc417b..bb2b0ba 100644 --- a/src/main/__tests__/editor-actions.test.ts +++ b/src/main/__tests__/editor-actions.test.ts @@ -60,11 +60,11 @@ describe('getGlobalConfigPath', () => { expect(getGlobalConfigPath()).toBe(path.join('/some/xdg', 'eca', 'config.json')); }); - it('uses macOS default on darwin when no env override', async () => { + it('uses ~/.config/eca/config.json on darwin when no env override', async () => { Object.defineProperty(process, 'platform', { value: 'darwin' }); const { getGlobalConfigPath } = await loadConstants(); expect(getGlobalConfigPath()).toBe( - path.join(os.homedir(), 'Library', 'Application Support', 'eca', 'config.json'), + path.join(os.homedir(), '.config', 'eca', 'config.json'), ); }); diff --git a/src/main/constants.ts b/src/main/constants.ts index 169cc1f..2761a12 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -38,9 +38,8 @@ export function getDataDir(): string { * 1. `ECA_CONFIG_PATH` environment variable (absolute path), if set. * 2. `$XDG_CONFIG_HOME/eca/config.json` if `XDG_CONFIG_HOME` is set. * 3. Platform default: - * - darwin: `~/Library/Application Support/eca/config.json` * - win32: `%APPDATA%\eca\config.json` (falls back to `~/.config/eca/config.json`) - * - others: `~/.config/eca/config.json` + * - others (macOS, Linux): `~/.config/eca/config.json` * * Note: this does not touch the filesystem. Creation is the caller's * responsibility. @@ -56,10 +55,6 @@ export function getGlobalConfigPath(): string { return path.join(xdg, 'eca', 'config.json'); } - if (process.platform === 'darwin') { - return path.join(os.homedir(), 'Library', 'Application Support', 'eca', 'config.json'); - } - if (process.platform === 'win32') { const appData = process.env.APPDATA; if (appData && appData.trim().length > 0) {