xiringuito/scripts/client-check-if-outdated.sh
Ivan Ilves c88d892fab 🤖
2017-04-23 19:58:37 +02:00

16 lines
458 B
Bash
Executable File

#!/usr/bin/env bash
#
# Check, if we are behind the latest master (and warn, if we are)
# NB! This is a very unusual script, if it fails, nothing breaks!
#
set -e
git remote update >/dev/null
REMOTE_TS=$(git show --pretty="format:%ct" origin/master | head -n1)
LOCAL_TS=$(git show --pretty="format:%ct" | head -n1)
if [[ ${LOCAL_TS} -lt ${REMOTE_TS} ]]; then
echo "*** WARNING: You are running outdated Xiringuito version. Remember: 'git pull' FTW!"
fi