@cenk1cenk2/oclif-common 3.0.0-beta.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -512,7 +512,7 @@ var ParserService = class {
|
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
getParser(file) {
|
|
515
|
-
const ext = this.fs.extname(file);
|
|
515
|
+
const ext = file.includes(".") ? this.fs.extname(file) : file;
|
|
516
516
|
const Parser = this.parsers.find((parser) => parser.extensions.includes(ext.replace(/^\./, "")));
|
|
517
517
|
if (!Parser) {
|
|
518
518
|
throw new Error(`Parser for the extension is not configured: ${ext}`);
|
|
@@ -634,6 +634,7 @@ var ConfigService = class {
|
|
|
634
634
|
}
|
|
635
635
|
async env(definition, config) {
|
|
636
636
|
const env = await this.parser.read(definition);
|
|
637
|
+
this.logger.trace("Environment variable extensions read: %s", definition);
|
|
637
638
|
const iter = /* @__PURE__ */ __name(async (obj, parent) => {
|
|
638
639
|
const data = await Promise.all(
|
|
639
640
|
Object.entries(obj).map(async ([key, value]) => {
|
|
@@ -665,10 +666,15 @@ var ConfigService = class {
|
|
|
665
666
|
return;
|
|
666
667
|
}
|
|
667
668
|
if (variable.parser) {
|
|
668
|
-
|
|
669
|
+
try {
|
|
670
|
+
data = await this.parser.parse(variable.parser, data);
|
|
671
|
+
} catch (e) {
|
|
672
|
+
this.logger.trace("Can not parse environment variable for config: %s -> %s with %s", variable.key.join("."), variable.env, variable.parser);
|
|
673
|
+
throw e;
|
|
674
|
+
}
|
|
669
675
|
}
|
|
670
676
|
config = import_object_path_immutable.default.update(config, variable.key, () => {
|
|
671
|
-
this.logger.trace("Overwriting config with environment variable: %s -> %s", variable.key.join("
|
|
677
|
+
this.logger.trace("Overwriting config with environment variable: %s -> %s", variable.key.join("."), variable.env);
|
|
672
678
|
return data;
|
|
673
679
|
});
|
|
674
680
|
})
|