Skip to content

Commit

Permalink
Update to match log style for new env loading (#12137)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored Apr 23, 2020
1 parent 5d13e55 commit 2ad3515
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/next/lib/load-env-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs'
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 dotenvExpand from 'next/dist/compiled/dotenv-expand'
import dotenv, { DotenvConfigOutput } from 'next/dist/compiled/dotenv'
Expand Down Expand Up @@ -88,16 +88,13 @@ export function loadEnvConfig(dir: string, dev?: boolean): Env | false {
result = dotenvExpand(result)

if (result.parsed) {
console.log(`> ${chalk.cyan.bold('Info:')} Loaded env from ${envFile}`)
log.info(`Loaded env from ${envFile}`)
}

Object.assign(combinedEnv, result.parsed)
} catch (err) {
if (err.code !== 'ENOENT') {
console.error(
`> ${chalk.cyan.bold('Error: ')} Failed to load env from ${envFile}`,
err
)
log.error(`Failed to load env from ${envFile}`, err)
}
}
}
Expand Down

0 comments on commit 2ad3515

Please sign in to comment.