Skip to content

Commit

Permalink
fix: log error if config loading fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sastan committed Mar 27, 2021
1 parent df14f3c commit af3fa11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export const loadFile = <T>(file: string, cwd = process.cwd()): T => {

// eslint-disable-next-line @typescript-eslint/no-var-requires
return require(moduleId) as T
} catch (error) {
console.error(
kleur.red(
`Failed to to load ${kleur.bold(Path.relative(process.cwd(), moduleId))}: ${error.message}`,
),
)

return {} as T
}
Expand Down

0 comments on commit af3fa11

Please sign in to comment.