From 5786c3eb71317a6a919dfbcfc9c14e44b1fd95c0 Mon Sep 17 00:00:00 2001 From: Tushar Mathur Date: Tue, 17 Jul 2018 12:24:54 +0530 Subject: [PATCH] fix(cli): handle when rc file is not available --- src/cli.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index d75a016..8a7a401 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -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} )