Skip to content

Commit

Permalink
fix: Make lang work on Mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
LindirQuenya committed Feb 5, 2022
1 parent 04c1eeb commit 451ce7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/back/index.ts
Expand Up @@ -460,7 +460,8 @@ async function onProcessMessage(message: any, sendHandle: any): Promise<void> {
}
});
state.languageWatcher.on('error', console.error);
const langFolder = path.join(content.isDev ? process.cwd() : path.dirname(content.exePath), 'lang');
// On mac, exePath is Flashpoint.app/Contents/MacOS/flashpoint, and lang is at Flashpoint.app/Contents/lang.
const langFolder = path.join(content.isDev ? process.cwd() : process.platform == 'darwin' ? path.resolve(path.dirname(content.exePath), '..') : path.dirname(content.exePath), 'lang');
fs.stat(langFolder, (error) => {
if (!error) { state.languageWatcher.watch(langFolder); }
else {
Expand Down

0 comments on commit 451ce7d

Please sign in to comment.