mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-06-30 23:12:45 +00:00
[cros] update remote url
This commit is contained in:
parent
502675f941
commit
7c1a102e1d
12
cros.sh
12
cros.sh
@ -23,15 +23,17 @@ function git_clone_or_pull {
|
||||
name=$(basename $2)
|
||||
if [[ -z $BARE ]]; then
|
||||
if [[ -d $DIRECTORY ]]; then
|
||||
git -C $DIRECTORY pull
|
||||
git -C "$DIRECTORY" remote set-url origin "$URL"
|
||||
git -C "$DIRECTORY" pull
|
||||
else
|
||||
git clone $URL $DIRECTORY
|
||||
git clone "$URL" "$DIRECTORY"
|
||||
fi
|
||||
else
|
||||
if [[ -d $DIRECTORY ]]; then
|
||||
git -C $DIRECTORY fetch --force --prune 2>&1 | sed "s/^/$name: /"
|
||||
if [[ -d "$DIRECTORY" ]]; then
|
||||
git -C "$DIRECTORY" remote set-url origin "$URL"
|
||||
git -C "$DIRECTORY" fetch --force --prune 2>&1 | sed "s/^/$name: /"
|
||||
else
|
||||
git clone --bare $URL $DIRECTORY
|
||||
git clone --bare "$URL" "$DIRECTORY"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user