Fix: return to previous directory in update_repo()

This commit is contained in:
DarkCat09 2024-04-08 19:15:39 +04:00
parent d56975633f
commit ad79fb5cbf
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -29,9 +29,11 @@ update_repo () {
if [ -e "$1" ]
then
echo "$1 exists, updating"
cd "$1" || return 3
old=$(pwd)
cd "$1" || exit 3
git stash && git stash drop
git pull
git pull || exit 2
cd "$old" || exit 3
else
echo "$1 not found, cloning"
clone "$2" "$1"