Skip to content

Commit 0b28fb3

Browse files
committedApr 6, 2019
misc(utils): refactors scaffold
refactors the conditional statements in scaffold.ts
1 parent b96857f commit 0b28fb3

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed
 

‎packages/utils/scaffold.ts

+10-16
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,16 @@ export default function runTransform(transformConfig: ITransformConfig, action:
9090
console.error(err.message ? err.message : err);
9191
});
9292
});
93-
93+
let successMessage : string = `Congratulations! Your new webpack configuration file has been created!\n`
9494
if (initActionNotDefined && transformConfig.config.item) {
95-
process.stdout.write(
96-
"\n" +
97-
chalk.green(
98-
`Congratulations! ${
99-
transformConfig.config.item
100-
} has been ${action}ed!\n`,
101-
),
102-
);
103-
} else {
104-
process.stdout.write(
105-
"\n" +
106-
chalk.green(
107-
"Congratulations! Your new webpack configuration file has been created!\n",
108-
),
109-
);
95+
successMessage = `Congratulations! ${
96+
transformConfig.config.item
97+
} has been ${action}ed!\n`
11098
}
99+
process.stdout.write(
100+
"\n" +
101+
chalk.green(
102+
successMessage
103+
)
104+
);
111105
}

0 commit comments

Comments
 (0)
Please sign in to comment.