@travetto/config
Advanced tools
Comparing version 0.0.31 to 0.0.32
@@ -19,3 +19,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.31" | ||
"version": "0.0.32" | ||
} |
@@ -1,5 +0,6 @@ | ||
import { bulkRead, bulkReadSync, AppEnv, bulkFindSync, findAppFilesByExt } from '@travetto/base'; | ||
import * as path from 'path'; | ||
import * as yaml from 'js-yaml'; | ||
import { readdirSync, readFileSync } from 'fs'; | ||
import { bulkRead, bulkReadSync, AppEnv, bulkFindSync, findAppFilesByExt } from '@travetto/base'; | ||
import { ConfigMap } from './map'; | ||
@@ -42,6 +43,6 @@ | ||
const files = allYaml.filter(x => | ||
x.file.includes('node_modules/@travetto') | ||
&& x.file.includes('/config/')) | ||
.concat(allYaml.filter(x => x.file.startsWith(`${process.cwd()}/config/`))) | ||
.map(x => ({ name: x.file, data: readFileSync(x.file).toString() })); | ||
x.file.includes(`node_modules/@travetto`) | ||
&& x.file.includes(`/config/`)) | ||
.concat(allYaml.filter(x => x.file.startsWith(`${AppEnv.cwd}/config/`))) | ||
.map(x => ({ name: x.nFile, data: readFileSync(x.nFile).toString() })); | ||
@@ -56,4 +57,4 @@ for (const file of files) { | ||
const loaded: string[] = []; | ||
const envFiles = allYaml.filter(x => x.file.startsWith(`${process.cwd()}/env/`)) | ||
.map(x => ({ name: x.file, data: readFileSync(x.file).toString() })) | ||
const envFiles = allYaml.filter(x => x.file.startsWith(`${AppEnv.cwd}/env/`)) | ||
.map(x => ({ name: x.nFile, data: readFileSync(x.nFile).toString() })) | ||
.map(x => { | ||
@@ -60,0 +61,0 @@ const tested = path.basename(x.name, '.yml'); |
8343