From 0b28fb337a1a9c491d2b5aacbc8ca9300f057906 Mon Sep 17 00:00:00 2001 From: Pranshu Chittora Date: Sat, 6 Apr 2019 19:48:12 +0530 Subject: [PATCH] misc(utils): refactors scaffold refactors the conditional statements in scaffold.ts --- packages/utils/scaffold.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/utils/scaffold.ts b/packages/utils/scaffold.ts index 7aa5ff7eb63..682f91ae989 100644 --- a/packages/utils/scaffold.ts +++ b/packages/utils/scaffold.ts @@ -90,22 +90,16 @@ export default function runTransform(transformConfig: ITransformConfig, action: console.error(err.message ? err.message : err); }); }); - + let successMessage : string = `Congratulations! Your new webpack configuration file has been created!\n` if (initActionNotDefined && transformConfig.config.item) { - process.stdout.write( - "\n" + - chalk.green( - `Congratulations! ${ - transformConfig.config.item - } has been ${action}ed!\n`, - ), - ); - } else { - process.stdout.write( - "\n" + - chalk.green( - "Congratulations! Your new webpack configuration file has been created!\n", - ), - ); + successMessage = `Congratulations! ${ + transformConfig.config.item + } has been ${action}ed!\n` } + process.stdout.write( + "\n" + + chalk.green( + successMessage + ) + ); }