Log config files read
This commit is contained in:
parent
6c2728228e
commit
2fb77382c9
@ -1,15 +1,13 @@
|
||||
import {ConfigReader} from './ConfigReader'
|
||||
import {join} from 'path'
|
||||
import {closeSync, openSync} from 'fs'
|
||||
import {writeFileSync} from 'fs'
|
||||
|
||||
describe('ConfigReader', () => {
|
||||
|
||||
beforeAll(() => {
|
||||
closeSync(
|
||||
openSync(
|
||||
writeFileSync(
|
||||
join(__dirname, 'test-files', 'package.json'),
|
||||
'w',
|
||||
),
|
||||
'{}',
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ import {Config} from './Config'
|
||||
import {findPackageRoot} from '../files/Find'
|
||||
import {join} from 'path'
|
||||
import {readFileSync} from 'fs'
|
||||
import {apiLogger} from '../logger'
|
||||
|
||||
const isObject = (value: any) => value !== null && typeof value === 'object'
|
||||
|
||||
@ -40,6 +41,7 @@ export class ConfigReader {
|
||||
}
|
||||
continue
|
||||
}
|
||||
apiLogger.info('config: Found config file: %s', configFilename)
|
||||
success += 1
|
||||
}
|
||||
}
|
||||
@ -50,10 +52,12 @@ export class ConfigReader {
|
||||
}
|
||||
|
||||
if (filename) {
|
||||
apiLogger.info('config: Reading extra config file: %s', filename)
|
||||
this.readFile(filename)
|
||||
}
|
||||
|
||||
if (env) {
|
||||
apiLogger.info('config: Parsing env variable: %s', this.environment)
|
||||
this.parse(env)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user