Update to match log style for new env loading (#12137)
This commit is contained in:
parent
5d13e55a4a
commit
2ad351511e
1 changed files with 3 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import chalk from 'next/dist/compiled/chalk'
|
import * as log from '../build/output/log'
|
||||||
import findUp from 'next/dist/compiled/find-up'
|
import findUp from 'next/dist/compiled/find-up'
|
||||||
import dotenvExpand from 'next/dist/compiled/dotenv-expand'
|
import dotenvExpand from 'next/dist/compiled/dotenv-expand'
|
||||||
import dotenv, { DotenvConfigOutput } from 'next/dist/compiled/dotenv'
|
import dotenv, { DotenvConfigOutput } from 'next/dist/compiled/dotenv'
|
||||||
|
@ -88,16 +88,13 @@ export function loadEnvConfig(dir: string, dev?: boolean): Env | false {
|
||||||
result = dotenvExpand(result)
|
result = dotenvExpand(result)
|
||||||
|
|
||||||
if (result.parsed) {
|
if (result.parsed) {
|
||||||
console.log(`> ${chalk.cyan.bold('Info:')} Loaded env from ${envFile}`)
|
log.info(`Loaded env from ${envFile}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(combinedEnv, result.parsed)
|
Object.assign(combinedEnv, result.parsed)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code !== 'ENOENT') {
|
if (err.code !== 'ENOENT') {
|
||||||
console.error(
|
log.error(`Failed to load env from ${envFile}`, err)
|
||||||
`> ${chalk.cyan.bold('Error: ')} Failed to load env from ${envFile}`,
|
|
||||||
err
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue