mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
prepend git output with repo name
This commit is contained in:
parent
f04e4c2d7e
commit
31c9fa7888
3
cros.sh
3
cros.sh
@ -20,6 +20,7 @@ function git_clone_or_pull {
|
|||||||
URL=$1
|
URL=$1
|
||||||
DIRECTORY=$2
|
DIRECTORY=$2
|
||||||
BARE=$3
|
BARE=$3
|
||||||
|
name=$(basename $2)
|
||||||
if [[ -z $BARE ]]; then
|
if [[ -z $BARE ]]; then
|
||||||
if [[ -d $DIRECTORY ]]; then
|
if [[ -d $DIRECTORY ]]; then
|
||||||
git -C $DIRECTORY pull
|
git -C $DIRECTORY pull
|
||||||
@ -28,7 +29,7 @@ function git_clone_or_pull {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ -d $DIRECTORY ]]; then
|
if [[ -d $DIRECTORY ]]; then
|
||||||
git -C $DIRECTORY fetch --force --prune
|
git -C $DIRECTORY fetch --force --prune 2>&1 | sed "s/^/$name: /"
|
||||||
else
|
else
|
||||||
git clone --bare $URL $DIRECTORY
|
git clone --bare $URL $DIRECTORY
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user