Unverified Commit 2ad35151 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update to match log style for new env loading (#12137)

parent 5d13e55a
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 { ...@@ -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
)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment