mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
8e8ec1348b
Closes #11876
27 lines
563 B
Bash
27 lines
563 B
Bash
function _git_commit_register {
|
|
if ! git config --global --get-all alias.$1 >/dev/null 2>&1; then
|
|
git config --global alias.$1 '!a() { if [[ "$1" == "-s" || "$1" == "--scope" ]]; then git commit -m "'$1'(${2}): ${@:3}"; else git commit -m "'$1': ${@}"; fi }; a'
|
|
fi
|
|
}
|
|
|
|
local -a _git_commit_aliases
|
|
_git_commit_aliases=(
|
|
'build'
|
|
'chore'
|
|
'ci'
|
|
'docs'
|
|
'feat'
|
|
'fix'
|
|
'perf'
|
|
'refactor'
|
|
'revert'
|
|
'style'
|
|
'test'
|
|
)
|
|
|
|
for _alias in "${_git_commit_aliases[@]}"; do
|
|
_git_commit_register $_alias
|
|
done
|
|
|
|
unfunction _git_commit_register
|
|
unset _alias
|