Allow ATOM_HOME to be reassigned if the new value is valid

This commit is contained in:
Max Brunsfeld
2016-08-15 17:05:18 -07:00
parent 4fe20fdde5
commit 8018dc9d57
2 changed files with 43 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/** @babel */
import fs from 'fs'
import {spawnSync} from 'child_process'
const ENVIRONMENT_VARIABLES_TO_PRESERVE = new Set([
@@ -37,6 +38,10 @@ function updateProcessEnv (launchEnv) {
process.env[key] = envToAssign[key]
}
}
if (envToAssign.ATOM_HOME && fs.existsSync(envToAssign.ATOM_HOME)) {
process.env.ATOM_HOME = envToAssign.ATOM_HOME
}
}
}