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:
parent
bac6fbaaf1
commit
2d90fd5c6b
@ -30,7 +30,11 @@ if (app.commandLine.getSwitchValue("proxy-server") !== "") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
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);
|
const workingDir = path.join(app.getPath("appData"), appName);
|
||||||
app.setName(appName);
|
app.setName(appName);
|
||||||
|
|||||||
@ -11,9 +11,10 @@ interface Env {
|
|||||||
* useful on macos where this always needs to be done.
|
* useful on macos where this always needs to be done.
|
||||||
* @param locale Should be electron's `app.getLocale()`
|
* @param locale Should be electron's `app.getLocale()`
|
||||||
*/
|
*/
|
||||||
export function shellSync(locale: string) {
|
export async function shellSync(locale: string) {
|
||||||
const { shell } = os.userInfo();
|
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) {
|
if (!env.LANG) {
|
||||||
// the LANG env var expects an underscore instead of electron's dash
|
// the LANG env var expects an underscore instead of electron's dash
|
||||||
env.LANG = `${locale.replace('-', '_')}.UTF-8`;
|
env.LANG = `${locale.replace('-', '_')}.UTF-8`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user