Fix: return to previous directory in update_repo()
This commit is contained in:
parent
d56975633f
commit
ad79fb5cbf
1 changed files with 4 additions and 2 deletions
6
build.sh
6
build.sh
|
@ -29,9 +29,11 @@ update_repo () {
|
||||||
if [ -e "$1" ]
|
if [ -e "$1" ]
|
||||||
then
|
then
|
||||||
echo "$1 exists, updating"
|
echo "$1 exists, updating"
|
||||||
cd "$1" || return 3
|
old=$(pwd)
|
||||||
|
cd "$1" || exit 3
|
||||||
git stash && git stash drop
|
git stash && git stash drop
|
||||||
git pull
|
git pull || exit 2
|
||||||
|
cd "$old" || exit 3
|
||||||
else
|
else
|
||||||
echo "$1 not found, cloning"
|
echo "$1 not found, cloning"
|
||||||
clone "$2" "$1"
|
clone "$2" "$1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue