mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
ELECTRON-1358 - Move setting shell path to main.ts to prevent multiple instance issue (#704)
This commit is contained in:
parent
494b886045
commit
9d887338e8
@ -1,8 +1,7 @@
|
||||
import { app } from 'electron';
|
||||
import * as path from 'path';
|
||||
import * as shellPath from 'shell-path';
|
||||
|
||||
import { isDevEnv, isMac } from '../common/env';
|
||||
import { isDevEnv } from '../common/env';
|
||||
import { logger } from '../common/logger';
|
||||
import { getCommandLineArgs } from '../common/utils';
|
||||
import { appStats } from './stats';
|
||||
@ -28,30 +27,5 @@ logger.info(`init: Fetch user data path`, app.getPath('userData'));
|
||||
// Log app statistics
|
||||
appStats.logStats();
|
||||
|
||||
// Setting the env path child_process issue https://github.com/electron/electron/issues/7688
|
||||
(async () => {
|
||||
try {
|
||||
const paths = await shellPath();
|
||||
if (paths) {
|
||||
return process.env.PATH = paths;
|
||||
}
|
||||
if (isMac) {
|
||||
process.env.PATH = [
|
||||
'./node_modules/.bin',
|
||||
'/usr/local/bin',
|
||||
process.env.PATH,
|
||||
].join(':');
|
||||
}
|
||||
} catch (e) {
|
||||
if (isMac) {
|
||||
process.env.PATH = [
|
||||
'./node_modules/.bin',
|
||||
'/usr/local/bin',
|
||||
process.env.PATH,
|
||||
].join(':');
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
// tslint:disable-next-line
|
||||
require('./main');
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { app } from 'electron';
|
||||
import * as shellPath from 'shell-path';
|
||||
|
||||
import { buildNumber, clientVersion, version } from '../../package.json';
|
||||
import { isDevEnv, isMac } from '../common/env';
|
||||
@ -19,6 +20,31 @@ logger.info(`App started with the args ${JSON.stringify(process.argv)}`);
|
||||
const allowMultiInstance: string | boolean = getCommandLineArgs(process.argv, '--multiInstance', true) || isDevEnv;
|
||||
let isAppAlreadyOpen: boolean = false;
|
||||
|
||||
// Setting the env path child_process issue https://github.com/electron/electron/issues/7688
|
||||
(async () => {
|
||||
try {
|
||||
const paths = await shellPath();
|
||||
if (paths) {
|
||||
return process.env.PATH = paths;
|
||||
}
|
||||
if (isMac) {
|
||||
process.env.PATH = [
|
||||
'./node_modules/.bin',
|
||||
'/usr/local/bin',
|
||||
process.env.PATH,
|
||||
].join(':');
|
||||
}
|
||||
} catch (e) {
|
||||
if (isMac) {
|
||||
process.env.PATH = [
|
||||
'./node_modules/.bin',
|
||||
'/usr/local/bin',
|
||||
process.env.PATH,
|
||||
].join(':');
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
handlePerformanceSettings();
|
||||
setChromeFlags();
|
||||
|
||||
|
@ -54,7 +54,6 @@ export class SpellChecker {
|
||||
|
||||
webContents.on('context-menu', contextMenuListener);
|
||||
webContents.once('destroyed', () => {
|
||||
logger.info(`spell-check-handler: web contents destroyed, removing context menu listener!`);
|
||||
webContents.removeListener('context-menu', contextMenuListener);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user