Skip to content

Commit

Permalink
fix(cli): handle when rc file is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Jul 17, 2018
1 parent b5c87ac commit 5786c3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ async function main() {
// read the config file
const config: TSCodemodRC = Object.assign(
{},
await fs.readJSON(path.resolve(process.cwd(), '.tscodemodrc')),
await fs
.readJSON(path.resolve(process.cwd(), '.tscodemodrc'))
// handle when file is not available
.catch(() => ({})),
{transformation, params}
)

Expand Down

0 comments on commit 5786c3e

Please sign in to comment.