Skip to content

Commit 1cc7a64

Browse files
committed
feat(commit.ts): add confirmation prompt and refactor commit message editing for better user experience
1 parent 4deb7bc commit 1cc7a64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/commands/commit.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
text,
3+
confirm,
34
intro,
45
isCancel,
56
multiselect,
@@ -99,10 +100,12 @@ ${chalk.grey('——————————————————')}`
99100
if (isCancel(userAction)) process.exit(1);
100101

101102
if (userAction === 'Edit') {
102-
commitMessage = await text({
103+
const textResponse = await text({
103104
message: 'Please edit the commit message: (press Enter to continue)',
104105
initialValue: commitMessage
105106
});
107+
108+
commitMessage = textResponse.toString();
106109
}
107110

108111
if (userAction === 'Yes' || userAction === 'Edit') {

0 commit comments

Comments
 (0)