From c8c92171856cf012fbf381e00216b6e77b52da14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20F=C3=BCcher?= Date: Wed, 29 Apr 2026 08:55:56 -0300 Subject: [PATCH] Fix macOS global config path to match ECA server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the darwin-specific branch in getGlobalConfigPath() that resolved to ~/Library/Application Support/eca/config.json. The ECA server uses ~/.config/eca/config.json on all platforms (including macOS), so the Settings → Global Config tab was pointing to the wrong file. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca-agent --- src/main/__tests__/editor-actions.test.ts | 4 ++-- src/main/constants.ts | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) 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) {