2 # performs svn update in this command's directory
4 function _svn_or_git () {
5 where="$1"; [ -z "$where" ] && where="."
8 [ -d .svn ] && { echo svn ; return ; }
9 [ -d .git ] && { echo git ; return ; }
10 [ "$(pwd -P)" == "/" ] && { echo none ; return ; }
15 # idem but runs in a subshell to protect cwd
16 function svn_or_git () { ( _svn_or_git "$@" ; ) }
19 # without an argument, use the place where the command is stored
20 if [[ -z "$@" ]] ; then
22 DIRNAME=$(cd $DIRNAME; pwd -P)
29 case $(_svn_or_git) in
30 svn) (date ; svn update ) >& .auto-update.log ;;
31 git) (date ; git pull ) >& .auto-update.log ;;
32 *) echo 'only svn and git are supported' >& .auto-update.log ;;