diff --git a/lib/utils/config/index.js b/lib/utils/config/index.js index 47b8815e8..0ba706cfe 100644 --- a/lib/utils/config/index.js +++ b/lib/utils/config/index.js @@ -23,10 +23,12 @@ function storeConfig(config) { try { writeFileAtomic.sync(serverlessrcPath, JSON.stringify(config, null, 2)); } catch (error) { - if (process.env.SLS_DEBUG) process.stdout.write(`${chalk.red(error.stack)}\n`); - process.stdout.write( - `Serverless: ${chalk.red(`Unable to store serverless config due to ${error.code} error`)}\n` - ); + if (process.env.SLS_DEBUG) { + process.stdout.write(`${chalk.red(error.stack)}\n`); + process.stdout.write( + `Serverless: ${chalk.red(`Unable to store serverless config due to ${error.code} error`)}\n` + ); + } try { return JSON.parse(readFileSync(serverlessrcPath)); } catch (readError) {