mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(electron): pre-create userData dir for Windows + stream logs in CI
Windows smoke test exits code=0 because requestSingleInstanceLock() fails silently when the APPDATA/<productName> directory doesn't exist. Pre-create the directory so the lock file can be written. Also enables ELECTRON_SMOKE_STREAM_LOGS=1 in CI for better debugging.
This commit is contained in:
2
.github/workflows/electron-release.yml
vendored
2
.github/workflows/electron-release.yml
vendored
@@ -137,12 +137,14 @@ jobs:
|
||||
if: matrix.platform != 'linux'
|
||||
env:
|
||||
ELECTRON_SMOKE_TIMEOUT_MS: 60000
|
||||
ELECTRON_SMOKE_STREAM_LOGS: "1"
|
||||
run: npm run electron:smoke:packaged
|
||||
|
||||
- name: Smoke packaged Electron app (Linux)
|
||||
if: matrix.platform == 'linux'
|
||||
env:
|
||||
ELECTRON_SMOKE_TIMEOUT_MS: 60000
|
||||
ELECTRON_SMOKE_STREAM_LOGS: "1"
|
||||
run: xvfb-run -a npm run electron:smoke:packaged
|
||||
|
||||
- name: Collect installers
|
||||
|
||||
@@ -367,6 +367,15 @@ async function ensureSmokeEnvDirs(smokeEnv, dataDir) {
|
||||
),
|
||||
];
|
||||
|
||||
// On Windows, Electron derives its userData from APPDATA/<productName>.
|
||||
// requestSingleInstanceLock() runs synchronously at module load and
|
||||
// fails silently if the directory doesn't exist yet — causing exit(0).
|
||||
if (platform() === "win32" && smokeEnv.APPDATA) {
|
||||
for (const subdir of ["omniroute-desktop", "OmniRoute", "omniroute"]) {
|
||||
dirs.push(join(smokeEnv.APPDATA, subdir));
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(dirs.map((dir) => mkdir(dir, { recursive: true })));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user