mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-31 19:27:00 -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 { app } from 'electron';
|
||||||
import * as path from 'path';
|
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 { logger } from '../common/logger';
|
||||||
import { getCommandLineArgs } from '../common/utils';
|
import { getCommandLineArgs } from '../common/utils';
|
||||||
import { appStats } from './stats';
|
import { appStats } from './stats';
|
||||||
@ -28,30 +27,5 @@ logger.info(`init: Fetch user data path`, app.getPath('userData'));
|
|||||||
// Log app statistics
|
// Log app statistics
|
||||||
appStats.logStats();
|
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
|
// tslint:disable-next-line
|
||||||
require('./main');
|
require('./main');
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { app } from 'electron';
|
import { app } from 'electron';
|
||||||
|
import * as shellPath from 'shell-path';
|
||||||
|
|
||||||
import { buildNumber, clientVersion, version } from '../../package.json';
|
import { buildNumber, clientVersion, version } from '../../package.json';
|
||||||
import { isDevEnv, isMac } from '../common/env';
|
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;
|
const allowMultiInstance: string | boolean = getCommandLineArgs(process.argv, '--multiInstance', true) || isDevEnv;
|
||||||
let isAppAlreadyOpen: boolean = false;
|
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();
|
handlePerformanceSettings();
|
||||||
setChromeFlags();
|
setChromeFlags();
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ export class SpellChecker {
|
|||||||
|
|
||||||
webContents.on('context-menu', contextMenuListener);
|
webContents.on('context-menu', contextMenuListener);
|
||||||
webContents.once('destroyed', () => {
|
webContents.once('destroyed', () => {
|
||||||
logger.info(`spell-check-handler: web contents destroyed, removing context menu listener!`);
|
|
||||||
webContents.removeListener('context-menu', contextMenuListener);
|
webContents.removeListener('context-menu', contextMenuListener);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user