Copy process.env before lower-casing the keys

`process.env` is read-only in GitBash (and potentially other consoles),
so the `lowerCase` flag had no effect.
This commit is contained in:
Jan Klosinski 2016-03-01 17:08:35 +00:00
parent 3d4e589578
commit 392c6022c9

View file

@ -60,8 +60,9 @@ Env.prototype.loadEnv = function () {
var env = process.env;
if (this.lowerCase) {
Object.keys(env).forEach(function (key) {
env[key.toLowerCase()] = env[key];
env = {};
Object.keys(process.env).forEach(function (key) {
env[key.toLowerCase()] = process.env[key];
});
}