Skip to content

Commit 6fb5f1f

Browse files
refactor: avoid duplication on success message
1 parent 5417080 commit 6fb5f1f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/core/ui/messages.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ const mountEmojiPrefixedMessage = (
2020
options?: PrefixedMessageOptions,
2121
) => mountPrefixedMessage(emoji.get(emojiName), message, options);
2222

23+
const mountSuccessPrefixedMessage = (message: string) =>
24+
mountEmojiPrefixedMessage('tada', message);
25+
2326
const mountErrorPrefixedMessage = (message: string) =>
2427
mountPrefixedMessage(ERROR_PREFIX, message);
2528

@@ -57,8 +60,7 @@ export const UNEXPECTED_ERROR = mountEmojiPrefixedMessage(
5760
// Actions
5861
// Add action
5962
export const ADD_ACTION_SUCCESS = (project: Project) =>
60-
mountEmojiPrefixedMessage(
61-
'tada',
63+
mountSuccessPrefixedMessage(
6264
`Wow! Your project "${chalk.yellow(
6365
project.getAlias(),
6466
)}" has been created with success!`,
@@ -68,8 +70,7 @@ export const ADD_ACTION_SUCCESS = (project: Project) =>
6870
export const WITH_ACTION_STARTED = `\nRunning your funny project tasks...\n`;
6971

7072
export const WITH_ACTION_DONE = (project: Project) =>
71-
mountEmojiPrefixedMessage(
72-
'tada',
73+
mountSuccessPrefixedMessage(
7374
`All tasks for ${chalk.yellow(project.getAlias())} has been executed!`,
7475
);
7576

0 commit comments

Comments
 (0)