mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
Fetch localfs environment variables from the login shell (fixes +6151)
This commit is contained in:
parent
cb8db3b002
commit
bb7b42efb4
16
node_modules/vfs-local/localfs.js
generated
vendored
16
node_modules/vfs-local/localfs.js
generated
vendored
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user