Skip to content

Commit da5bc62

Browse files
committed
feat(template.sh): add editing capabilities
From now on, commands can be edited and moved back and forward between words with the keys.
1 parent 991d15e commit da5bc62

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

template.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ printf "${CYAN}10. chore${RESET} - Other changes that don't modify src or test f
3232
printf "${CYAN}11. revert${RESET} - Reverts a previous commit.\n\n"
3333

3434
while :; do
35-
read TYPE
35+
read -e TYPE
3636
# To lower case
3737
TYPE=${TYPE,,}
3838
# When input type is valid loop break
@@ -49,7 +49,7 @@ done
4949
# Scppe section
5050
printf "\n${BLUE}>>> Scope of this change (optional)?${RESET}\n"
5151
printf "The scope could be anything specifying place of the commit change e.g a file name, function name, class name, component name etc.\n\n"
52-
read SCOPE
52+
read -e SCOPE
5353

5454
# Subject section
5555
printf "\n${BLUE}>>> Short description?${RESET}\n"
@@ -59,7 +59,7 @@ printf " • don't capitalize first letter\n"
5959
printf " • no dot (.) at the end\n\n"
6060

6161
while :; do
62-
read SHORT_DESC
62+
read -e SHORT_DESC
6363
if [ -z "$SHORT_DESC" ]; then
6464
printf "${RED}❌ Short description can not be empty.${RESET}\n"
6565
else
@@ -70,20 +70,20 @@ done
7070
# Description section
7171
printf "\n${BLUE}>>> Long description (optional)?${RESET}\n"
7272
printf "The body should include the motivation for the change and contrast this with previous behavior.\n\n"
73-
read LONG_DESC
73+
read -e LONG_DESC
7474

7575
# Breaking changes section
7676
printf "\n${BLUE}>>> Breaking changes (optional)?${RESET}\n"
7777
printf "note the reason for a breaking change within the commit.\n\n"
78-
read BREAKING_CHANGES
78+
read -e BREAKING_CHANGES
7979

8080
# Closed issues section
8181
printf "\n${BLUE}>>> Closed issues (optional)?${RESET}\n"
8282
printf "The syntax for closing keywords depends on whether the issue is in the same repository as the pull request.\n"
8383
printf " • Issue in the same repository -> Closes #10\n"
8484
printf " • Issue in a different repository -> Fixes octo-org/octo-repo#100\n"
8585
printf " • Multiple issues -> Resolves #10, resolves #123, resolves octo-org/octo-repo#100\n\n"
86-
read CLOSED_ISSUES
86+
read -e CLOSED_ISSUES
8787

8888
# Result section
8989
if [ ! -z "$SCOPE" ]; then

0 commit comments

Comments
 (0)