mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 15:15:12 +08:00
fix(boot): Copy env from main process into renderer process on linux
See: https://github.com/atom/electron/issues/3306 This was casuing NYLAS_HOME to be unavailable on the renderer process
This commit is contained in:
parent
809f4d827e
commit
d759f6039b
1 changed files with 14 additions and 0 deletions
|
@ -21,7 +21,21 @@ function handleSetupError (error) {
|
|||
console.error(error.stack || error)
|
||||
}
|
||||
|
||||
function copyEnvFromMainProcess() {
|
||||
var _ = require('underscore');
|
||||
var remote = require('remote');
|
||||
var newEnv = _.extend({}, process.env, remote.process.env);
|
||||
process.env = newEnv;
|
||||
}
|
||||
|
||||
function setupWindow (loadSettings) {
|
||||
if (process.platform === 'linux') {
|
||||
// This will properly inherit process.env from the main process, which it
|
||||
// doesn't do by default on Linux. See:
|
||||
// https://github.com/atom/electron/issues/3306
|
||||
copyEnvFromMainProcess();
|
||||
}
|
||||
|
||||
var hotreload = loadSettings.devMode && !loadSettings.isSpec;
|
||||
var CompileCache = require('../src/compile-cache')
|
||||
CompileCache.setHotReload(hotreload)
|
||||
|
|
Loading…
Reference in a new issue