feat: improve dot as a real wrapper around git
`dot` can now take the exact same arguments as git, transparently -> flags are now optionnal
This commit is contained in:
parent
6f6280ca4a
commit
bf136ba0c1
|
@ -11,10 +11,9 @@
|
|||
|
||||
|
||||
git="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
|
||||
cmd="$git status" # by default, give the status
|
||||
|
||||
[ "$1" = "-g" ] && shift && cmd="$git $@" # make the wrapper transparent
|
||||
|
||||
case $1 in
|
||||
-*)
|
||||
[ "$1" = "-l" ] && shift && cmd="$git log"
|
||||
[ "$1" = "-lg" ] && shift && cmd="$git log --graph --format=short"
|
||||
[ "$1" = "-c" ] && shift && cmd="$git commit $@"
|
||||
|
@ -50,5 +49,10 @@ if [ "$1" = "-m" ] ; then
|
|||
fi
|
||||
cmd="$git checkout dev"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
[ "$1" != "" ] && cmd="$git $@" || cmd="$git status"
|
||||
;;
|
||||
esac
|
||||
|
||||
$cmd
|
||||
|
|
Reference in New Issue