mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 18:31:59 +00:00
parent
bae577d6b2
commit
8e8ec1348b
1 changed files with 10 additions and 6 deletions
|
@ -1,10 +1,11 @@
|
||||||
_register() {
|
function _git_commit_register {
|
||||||
if ! git config --global --get-all alias.$1 &>/dev/null; then
|
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'
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
aliases=(
|
local -a _git_commit_aliases
|
||||||
|
_git_commit_aliases=(
|
||||||
'build'
|
'build'
|
||||||
'chore'
|
'chore'
|
||||||
'ci'
|
'ci'
|
||||||
|
@ -18,6 +19,9 @@ aliases=(
|
||||||
'test'
|
'test'
|
||||||
)
|
)
|
||||||
|
|
||||||
for alias in "${aliases[@]}"; do
|
for _alias in "${_git_commit_aliases[@]}"; do
|
||||||
_register $alias
|
_git_commit_register $_alias
|
||||||
done
|
done
|
||||||
|
|
||||||
|
unfunction _git_commit_register
|
||||||
|
unset _alias
|
||||||
|
|
Loading…
Reference in a new issue