diff --git a/src/main/index.ts b/src/main/index.ts index f608490ed1..478992201d 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -30,7 +30,11 @@ if (app.commandLine.getSwitchValue("proxy-server") !== "") { } async function main() { - shellSync(app.getLocale()); + try { + await shellSync(app.getLocale()); + } catch (err) { + logger.warn("shellSync: ", err); + } const workingDir = path.join(app.getPath("appData"), appName); app.setName(appName); diff --git a/src/main/shell-sync.ts b/src/main/shell-sync.ts index 101fd46bc9..c7cf753e16 100644 --- a/src/main/shell-sync.ts +++ b/src/main/shell-sync.ts @@ -11,9 +11,10 @@ interface Env { * useful on macos where this always needs to be done. * @param locale Should be electron's `app.getLocale()` */ -export function shellSync(locale: string) { +export async function shellSync(locale: string) { const { shell } = os.userInfo(); - const env: Env = JSON.parse(JSON.stringify(shellEnv.sync(shell))) + + const env: Env = JSON.parse(JSON.stringify(await shellEnv(shell))) if (!env.LANG) { // the LANG env var expects an underscore instead of electron's dash env.LANG = `${locale.replace('-', '_')}.UTF-8`;