Skip to content

Commit fc088f4

Browse files
committed
-amUPDATED:Changingcommit-amrecognition
1 parent 3586a26 commit fc088f4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

data/features/commit/commit.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
commit()
44
{
55
messag="$@"
6-
while [ -z "$messag" ]; do
6+
while [ -z "${messag}" ]; do
77
read -p "Add message: " messag
88
done
9-
git commit -am "$messag"
9+
10+
trimmedArgs=
11+
for word in ${messag}; do
12+
if ! echo "${word}" | grep -qE "-am|-ma|-m|-a"; then
13+
trimmedArgs+=${word}
14+
fi
15+
done
16+
17+
git commit -am "${trimmedArgs}"
1018
}
1119
if [ -f "€{BASH_COMPLETIONS_PATH}" ]; then
1220
source "€{BASH_COMPLETIONS_PATH}"

0 commit comments

Comments
 (0)