Fetch localfs environment variables from the login shell (fixes +6151)

This commit is contained in:
nightwing 2015-02-22 18:00:42 +04:00
parent cb8db3b002
commit bb7b42efb4

16
node_modules/vfs-local/localfs.js generated vendored
View File

@ -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