From bedd361059d4488cc7a5ae79cff49a6d0204efb6 Mon Sep 17 00:00:00 2001 From: andryyy Date: Thu, 29 Jun 2017 17:42:37 +0200 Subject: [PATCH] Test new update check --- update.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/update.sh b/update.sh index ed87dc6c..da3b2262 100755 --- a/update.sh +++ b/update.sh @@ -20,6 +20,20 @@ set -o pipefail export LC_ALL=C DATE=$(date +%Y-%m-%d_%H_%M_%S) BRANCH=$(git rev-parse --abbrev-ref HEAD) + +case "${1}" in + --check|-c) + echo "Checking remote code for updates..." + git fetch + if ! git diff --quiet --exit-code; then + echo "Updated code is available." + else + echo "No updates available." + fi + exit 0 + ;; +esac + TMPFILE=$(mktemp "${TMPDIR:-/tmp}/curldata.XXXXXX") echo -e "\e[32mChecking for newer update script...\e[0m"