Updated Update logic

This commit is contained in:
Netkas 2021-01-27 21:25:55 -05:00
parent 8ccd8ef874
commit b63718ae75
1 changed files with 14 additions and 4 deletions

View File

@ -5,14 +5,24 @@ cd /CoffeeHousePy
echo "### Checking for updates ###"
git remote update
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
BASE=$(git merge-base @ "$UPSTREAM")
#UPSTREAM=${1:-'@{u}'}
#LOCAL=$(git rev-parse @)
#BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $BASE ]; then
#if [ $LOCAL = $BASE ]; then
# echo "### Applying update ###"
# git pull
# make clean install
#fi
changed=0
git remote update && git status -uno | grep -q 'Your branch is behind' && changed=1
if [ $changed = 1 ]; then
echo "### Applying update ###"
git pull
make clean install
else
echo "### CoffeeHouse-Utils is up-to-date ###"
fi
echo "### Starting CoffeeHouse-LangDetect ###"