prepend git output with repo name

This commit is contained in:
admin 2020-05-08 23:19:31 +08:00
parent f04e4c2d7e
commit 31c9fa7888

View File

@ -20,6 +20,7 @@ function git_clone_or_pull {
URL=$1
DIRECTORY=$2
BARE=$3
name=$(basename $2)
if [[ -z $BARE ]]; then
if [[ -d $DIRECTORY ]]; then
git -C $DIRECTORY pull
@ -28,7 +29,7 @@ function git_clone_or_pull {
fi
else
if [[ -d $DIRECTORY ]]; then
git -C $DIRECTORY fetch --force --prune
git -C $DIRECTORY fetch --force --prune 2>&1 | sed "s/^/$name: /"
else
git clone --bare $URL $DIRECTORY
fi