Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(electron): electron dev startup on win (#5031)

Peng Xiao8841dc3c4eec
diff --git a/packages/frontend/electron/scripts/dev.ts b/packages/frontend/electron/scripts/dev.ts
index 03796db9e7..fa22326a49 100644
--- a/packages/frontend/electron/scripts/dev.ts
+++ b/packages/frontend/electron/scripts/dev.ts
@@ -1,10 +1,11 @@
import { spawn } from 'node:child_process';
+import { resolve } from 'node:path';
import type { ChildProcessWithoutNullStreams } from 'child_process';
import type { BuildContext } from 'esbuild';
import * as esbuild from 'esbuild';
-import { config, electronDir } from './common';
+import { config, electronDir, rootDir } from './common';
// this means we don't spawn electron windows, mainly for testing
const watchMode = process.argv.includes('--watch');
@@ -29,7 +30,10 @@ function spawnOrReloadElectron() {
spawnProcess = null;
}
- spawnProcess = spawn('electron', ['.'], {
+ const ext = process.platform === 'win32' ? '.cmd' : '';
+ const exe = resolve(rootDir, 'node_modules', '.bin', `electron${ext}`);
+
+ spawnProcess = spawn(exe, ['.'], {
cwd: electronDir,
env: process.env,
});