From 2ca5e92fd51a8fc103460041ddcc1ba633b9c51e Mon Sep 17 00:00:00 2001 From: TC Date: Tue, 16 Jun 2026 22:33:34 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20userData=20permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/globalConfig.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/globalConfig.ts b/src/main/globalConfig.ts index d077cce..2ccea14 100644 --- a/src/main/globalConfig.ts +++ b/src/main/globalConfig.ts @@ -1,7 +1,6 @@ -import { app } from 'electron' import { join, basename } from 'path' import { homedir } from 'os' -import { readFileSync, writeFileSync, mkdirSync, existsSync, copyFileSync } from 'fs' +import { readFileSync, writeFileSync, mkdirSync } from 'fs' export interface RecentProject { path: string @@ -15,19 +14,12 @@ export interface GlobalConfig { recentProjects?: RecentProject[] } -const CONFIG_DIR = app.getPath('userData') +const CONFIG_DIR = join(homedir(), '.hohoff') const CONFIG_FILE = join(CONFIG_DIR, 'config.json') -// Migrate config from legacy ~/.hohoff location on first run -const LEGACY_CONFIG_FILE = join(homedir(), '.hohoff', 'config.json') - let _config: GlobalConfig = {} try { - if (!existsSync(CONFIG_FILE) && existsSync(LEGACY_CONFIG_FILE)) { - mkdirSync(CONFIG_DIR, { recursive: true }) - copyFileSync(LEGACY_CONFIG_FILE, CONFIG_FILE) - } const raw = JSON.parse(readFileSync(CONFIG_FILE, 'utf-8')) // Migrate old string[] recentProjects to RecentProject[] if (Array.isArray(raw.recentProjects) && typeof raw.recentProjects[0] === 'string') {