kopia lustrzana https://github.com/c9/core
Fetch localfs environment variables from the login shell (fixes +6151)
rodzic
cb8db3b002
commit
bb7b42efb4
|
@ -129,7 +129,21 @@ module.exports = function setup(fsOptions) {
|
|||
} else {
|
||||
fsOptions.defaultEnv = process.env;
|
||||
}
|
||||
|
||||
|
||||
// Fetch environment variables from the login shell
|
||||
if (!isWin) {
|
||||
_execFile(BASH, ["-lc", "printenv -0"], function(error, stdout, stderr) {
|
||||
if (!error && !stderr && stdout) {
|
||||
var env = fsOptions.defaultEnv;
|
||||
stdout.split("\x00").forEach(function(entry) {
|
||||
var i = entry.indexOf("=");
|
||||
if (i != -1)
|
||||
env[entry.slice(0, i)] = entry.slice(i + 1);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Storage for extension APIs
|
||||
var apis = {};
|
||||
// Storage for event handlers
|
||||
|
|
Ładowanie…
Reference in New Issue