git-srv-admin.sh: Allow non-existing $pdir

Non-existing projects directories should not break the build, so just
silently allow that to happen.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-02-25 12:02:46 +00:00
commit d890969c82

View file

@ -95,6 +95,7 @@ create_repo()
list_repos() list_repos()
{ {
[ -d $pdir ] || return 0
cd $pdir || return 1 cd $pdir || return 1
ls */HEAD | sed 's%/HEAD%%' 2>/dev/null ls */HEAD | sed 's%/HEAD%%' 2>/dev/null
return $? return $?
@ -124,7 +125,6 @@ while getopts jhu:F: flag; do
usage 1;; usage 1;;
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
if [ "$user" ]; then if [ "$user" ]; then