Improve autoinstall

This commit is contained in:
Tobias Reisinger 2022-10-17 21:37:38 +02:00
parent b5764c0376
commit 57cd02890a
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
8 changed files with 92 additions and 187 deletions

View file

@ -1,31 +0,0 @@
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi oleksandr.shybystyi@gmail.com
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
'reset'
'commit'
'checkout'
'mv'
'init'
)
# taken from http://stackoverflow.com/a/8574392/4647743
function elementInArray() {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
function git() {
command git $@
if (elementInArray $1 $gitPreAutoStatusCommands); then
command git status
fi
}