mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
1. Set shell-path (#659)
1. Add isMac check for set path if shell path has errors.
This commit is contained in:
parent
fe77bc259b
commit
e094aa7fff
@ -1,7 +1,8 @@
|
|||||||
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 } from '../common/env';
|
import { isDevEnv, isMac } from '../common/env';
|
||||||
import { getCommandLineArgs } from '../common/utils';
|
import { getCommandLineArgs } from '../common/utils';
|
||||||
|
|
||||||
// Handle custom user data path from process.argv
|
// Handle custom user data path from process.argv
|
||||||
@ -18,5 +19,30 @@ if (userDataPath) {
|
|||||||
app.setPath('userData', userDataPath);
|
app.setPath('userData', userDataPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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');
|
||||||
|
Loading…
Reference in New Issue
Block a user