mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-03-13 21:33:22 +01:00
fix: remove flags automatically
This commit is contained in:
parent
ffcf44621e
commit
52ef4ad669
1 changed files with 1 additions and 6 deletions
|
@ -27,7 +27,7 @@ remove_flags() {
|
|||
local message="$1"
|
||||
local flags=("${@:2}")
|
||||
|
||||
local regex=$(IFS="|"; echo "${flags[*]}")
|
||||
local regex=$(IFS="|"; echo "${_git_commit_flags[*]}")
|
||||
|
||||
message=$(sed -E "s/\s($regex)\s|\s($regex)$//g" <<< "$message")
|
||||
|
||||
|
@ -38,23 +38,18 @@ build_message () {
|
|||
if [[ "$*" =~ (-sa|-as) ]]; then
|
||||
local attention='!'
|
||||
local scope="($2)"
|
||||
shift 2
|
||||
elif [[ "$1" =~ (-a|--attention) ]]; then
|
||||
local attention='!'
|
||||
shift 1
|
||||
elif [[ "$2" =~ (-a|--attention) ]]; then
|
||||
local attention='!'
|
||||
shift 1
|
||||
elif [[ "$*" =~ (-a|--attention) ]]; then
|
||||
local attention='!'
|
||||
fi
|
||||
|
||||
if [[ "$*" =~ (-s|--scope) ]]; then
|
||||
local scope="($2)"
|
||||
shift 2
|
||||
elif [[ "$2" =~ (-s|--scope) ]]; then
|
||||
local scope="($3)"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
local message="'$type'${scope}$attention: $@";
|
||||
|
|
Loading…
Add table
Reference in a new issue