From 392c6022c9d43c6751e3d9d0cae6411f9537507f Mon Sep 17 00:00:00 2001 From: Jan Klosinski Date: Tue, 1 Mar 2016 17:08:35 +0000 Subject: [PATCH] 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. --- lib/nconf/stores/env.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/nconf/stores/env.js b/lib/nconf/stores/env.js index 362d008..47ac3bc 100644 --- a/lib/nconf/stores/env.js +++ b/lib/nconf/stores/env.js @@ -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]; }); }