mirror of
https://github.com/DeNNiiInc/Advanced-Raid-Calculator.git
synced 2026-04-17 12:45:59 +00:00
27 lines
591 B
Bash
27 lines
591 B
Bash
#!/bin/bash
|
|
|
|
# Ensure we are in the project directory
|
|
cd "$(dirname "$0")"
|
|
|
|
# Fetch the latest changes from the remote
|
|
git remote update
|
|
|
|
# Check if local is behind remote (UPSTREAM)
|
|
UPSTREAM=${1:-'@{u}'}
|
|
LOCAL=$(git rev-parse @)
|
|
REMOTE=$(git rev-parse "$UPSTREAM")
|
|
BASE=$(git merge-base @ "$UPSTREAM")
|
|
|
|
if [ $LOCAL = $REMOTE ]; then
|
|
echo "Up-to-date"
|
|
elif [ $LOCAL = $BASE ]; then
|
|
echo "Need to pull"
|
|
git pull
|
|
# Re-run deploy to handle deps, service updates, and permissions
|
|
./deploy.sh
|
|
elif [ $REMOTE = $BASE ]; then
|
|
echo "Need to push"
|
|
else
|
|
echo "Diverged"
|
|
fi
|