Skip to content

Commit c7a51db

Browse files
Release fix (#12)
* fix release workflow * fix release 2
1 parent 6fb23f9 commit c7a51db

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

electron-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ files:
88
- dist-electron/**/*
99
extraResources:
1010
- from: config.default.json
11-
to: ../config.json
11+
to: config.json
1212
win:
1313
icon: build/icon.ico
1414
target:

electron/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import fs from 'node:fs';
55

66
const __dirname = path.dirname(fileURLToPath(import.meta.url));
77

8-
// config.json lives next to the app:
8+
// Config paths:
99
// dev → project root (process.cwd()), falls back to config.default.json
10-
// prod → next to the executable (shipped from config.default.json)
11-
const appDir = app.isPackaged ? path.dirname(process.execPath) : process.cwd();
12-
const configPath = path.join(appDir, 'config.json');
13-
const defaultConfigPath = path.join(appDir, 'config.default.json');
10+
// prod → extraResources dir (Contents/Resources on macOS, resources/ on Linux/Windows)
11+
const configDir = app.isPackaged ? process.resourcesPath : process.cwd();
12+
const configPath = path.join(configDir, 'config.json');
13+
const defaultConfigPath = path.join(configDir, 'config.default.json');
1414

1515
interface Config {
1616
host: string;

0 commit comments

Comments
 (0)