@@ -37,12 +37,6 @@ export class BackendGenerator extends AbstractGenerator {
37
37
38
38
require('@theia/core/shared/reflect-metadata');
39
39
40
- // Useful for Electron/NW.js apps as GUI apps on macOS doesn't inherit the \`$PATH\` define
41
- // in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).
42
- // https://github.com/electron/electron/issues/550#issuecomment-162037357
43
- // https://github.com/eclipse-theia/theia/pull/3534#issuecomment-439689082
44
- require('@theia/core/electron-shared/fix-path').default();
45
-
46
40
// Workaround for https://github.com/electron/electron/issues/9225. Chrome has an issue where
47
41
// in certain locales (e.g. PL), image metrics are wrongly computed. We explicitly set the
48
42
// LC_NUMERIC to prevent this from happening (selects the numeric formatting category of the
@@ -52,18 +46,24 @@ if (process.env.LC_ALL) {
52
46
}
53
47
process.env.LC_NUMERIC = 'C';
54
48
55
- const { resolve } = require('path');
56
- const theiaAppProjectPath = resolve(__dirname, '..', '..');
57
- process.env.THEIA_APP_PROJECT_PATH = theiaAppProjectPath;
58
- const { default: electronMainApplicationModule } = require('@theia/core/lib/electron-main/electron-main-application-module');
59
- const { ElectronMainApplication, ElectronMainApplicationGlobals } = require('@theia/core/lib/electron-main/electron-main-application');
60
- const { Container } = require('@theia/core/shared/inversify');
61
- const { app } = require('electron');
62
-
63
- const config = ${ this . prettyStringify ( this . pck . props . frontend . config ) } ;
64
- const isSingleInstance = ${ this . pck . props . backend . config . singleInstance === true ? 'true' : 'false' } ;
65
-
66
49
(async () => {
50
+ // Useful for Electron/NW.js apps as GUI apps on macOS doesn't inherit the \`$PATH\` define
51
+ // in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).
52
+ // https://github.com/electron/electron/issues/550#issuecomment-162037357
53
+ // https://github.com/eclipse-theia/theia/pull/3534#issuecomment-439689082
54
+ (await require('@theia/core/electron-shared/fix-path')).default();
55
+
56
+ const { resolve } = require('path');
57
+ const theiaAppProjectPath = resolve(__dirname, '..', '..');
58
+ process.env.THEIA_APP_PROJECT_PATH = theiaAppProjectPath;
59
+ const { default: electronMainApplicationModule } = require('@theia/core/lib/electron-main/electron-main-application-module');
60
+ const { ElectronMainApplication, ElectronMainApplicationGlobals } = require('@theia/core/lib/electron-main/electron-main-application');
61
+ const { Container } = require('@theia/core/shared/inversify');
62
+ const { app } = require('electron');
63
+
64
+ const config = ${ this . prettyStringify ( this . pck . props . frontend . config ) } ;
65
+ const isSingleInstance = ${ this . pck . props . backend . config . singleInstance === true ? 'true' : 'false' } ;
66
+
67
67
if (isSingleInstance && !app.requestSingleInstanceLock()) {
68
68
// There is another instance running, exit now. The other instance will request focus.
69
69
app.quit();
0 commit comments