You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
821 B
30 lines
821 B
#!/bin/bash
|
|
clear
|
|
if [ -z "$1" ]; then
|
|
/bin/echo "Please enter you GIT Folder"
|
|
exit 1
|
|
else
|
|
/bin/echo "Warning: All local code, in $1, on this PC will be wiped out!!!"
|
|
/bin/echo "Please type: yes (hit enter), to do a git pull to make your local copy up to date!"
|
|
read -r agree
|
|
if [ "$agree" = "yes" ]; then
|
|
cd "$1" || { echo "Unable to CD into $1 !!"; exit 1; }
|
|
branch=$(git symbolic-ref --short -q HEAD)
|
|
branch=${branch:-HEAD}
|
|
/usr/bin/git pull origin "$branch"
|
|
gpobs=$?
|
|
if [ "$gpobs" -eq "0" ]; then
|
|
/bin/echo "Updated..."
|
|
read -r -n 1 -p "Press any key to continue..."
|
|
else
|
|
/bin/echo "Error!!!!"
|
|
read -r -n 1 -p "Hit a key..."
|
|
exit 1
|
|
fi
|
|
/bin/echo "thanks"
|
|
else
|
|
/bin/echo "Skipped update..."
|
|
read -r -n 1 -p "Press any key to continue..."
|
|
/bin/echo ""
|
|
fi
|
|
fi
|
|
|