1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var graphql_codegen_core_1 = require("graphql-codegen-core");
|
4 | var js_yaml_1 = require("js-yaml");
|
5 | function parseConfigFile(ymlString) {
|
6 | if (typeof process !== 'undefined' && 'env' in process) {
|
7 | graphql_codegen_core_1.debugLog("[CLI] Interpolation of Environmental Variables");
|
8 | ymlString = ymlString.replace(/\$\{(.*)\}/g, function (str, variable, index) { return process.env[variable]; });
|
9 | }
|
10 | graphql_codegen_core_1.debugLog("[CLI] Parsing YAML file");
|
11 | return js_yaml_1.safeLoad(ymlString);
|
12 | }
|
13 | exports.parseConfigFile = parseConfigFile;
|
14 |
|
\ | No newline at end of file |