commit 10582c30b53de823811106962a4419f54d2e636c
parent 092866b8d4290491275abb84aa5a58e738c2b6c8
Author: nolash <dev@holbrook.no>
Date: Thu, 10 Dec 2020 12:02:47 +0100
Fix rouge string 'undefined'
Diffstat:
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
@@ -1,3 +1,5 @@
+* 0.0.5
+ - Remove rouge concat of string literal 'undefined' in env var
* 0.0.4
- Continue on unmatched file name
* 0.0.3
diff --git a/package.json b/package.json
@@ -1,6 +1,6 @@
{
"name": "confini",
- "version": "0.0.4",
+ "version": "0.0.5",
"description": "Merge all ini configuration files from a folder",
"main": "dist/index.js",
"scripts": {
diff --git a/src/config.ts b/src/config.ts
@@ -39,7 +39,10 @@ class Config {
const kkk = k + '_' + kk;
let r = inid[k_section][k_directive];
- const k_env = this.env_prefix + kkk
+ let k_env = kkk;
+ if (this.env_prefix !== undefined) {
+ k_env = this.env_prefix + '_' + k_env;
+ }
const env = process.env[k_env];
if (env !== undefined) {
console.debug('Environment variable ' + k_env + ' overrides ' + kkk);