Skip to content

Commit b2cbec0

Browse files
committed
fix: wp bin path on prod
1 parent 438870b commit b2cbec0

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/app/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/ipcListeners/wp.ts

+10-22
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,17 @@ ipcMain.on('wp-start', async (event, arg) => {
8282
console.log(8, app.getAppPath().replace('/app.asar', ''));
8383
console.log(
8484
9,
85-
String(
86-
path.join(app.getAppPath(), 'assets', 'bin', 'warp-plus')
87-
).replace('/app.asar', '')
85+
String(path.join(app.getAppPath().replace('/app.asar', ''), 'assets', 'bin', 'warp-plus'))
86+
);
87+
console.log(10, path.join(app.getAppPath().replace('/app.asar', ''), 'assets', 'bin'));
88+
89+
const wpFileName = `warp-plus${platform === 'win32' ? '.exe' : ''}`;
90+
const command = path.join(
91+
app.getAppPath().replace('/app.asar', ''),
92+
'assets',
93+
'bin',
94+
wpFileName
8895
);
89-
90-
let command = '';
91-
if (platform === 'win32') {
92-
if (isDev()) {
93-
command = path.join('assets', 'bin', 'warp-plus.exe');
94-
} else {
95-
command = String(
96-
path.join(app.getAppPath(), 'resources', 'assets', 'bin', 'warp-plus.exe')
97-
).replace('/app.asar', '');
98-
}
99-
} else {
100-
if (isDev()) {
101-
command = path.join('assets', 'bin', 'warp-plus');
102-
} else {
103-
command = String(
104-
path.join(app.getAppPath(), 'resources', 'assets', 'bin', 'warp-plus')
105-
).replace('/app.asar', '');
106-
}
107-
}
10896
console.log('command', command);
10997

11098
child = spawn(command, args);

0 commit comments

Comments
 (0)