1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

catch and log error from shell sync

Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
Sebastian Malton 2020-07-31 09:49:09 -04:00
parent bac6fbaaf1
commit 2d90fd5c6b
2 changed files with 8 additions and 3 deletions

View File

@ -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);

View File

@ -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`;