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