From 6afbbe88c82abd1316aec2ebff69b57d6a422a32 Mon Sep 17 00:00:00 2001 From: Eric Keller Date: Sat, 2 Sep 2017 18:26:57 +0200 Subject: [PATCH] fixup when remote is set to git protocol --- tools/check_for_upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 21c418e09..45c337fc3 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -31,6 +31,12 @@ whence git >/dev/null || return 0 # Skip when no internet connectivity, depends on curl REMOTE=$(cd "$ZSH" && git remote get-url --all origin) +echo "$REMOTE" | grep -qa 'git@' +if [ $? -eq 0 ] +then + # convert the remote protocol to https + REMOTE=$(echo $REMOTE | tr ':' '/' | sed -e "s#git@#https://#") +fi # -L follow redirect, -s silent, # --max-time overall operation timeout, -I only download headers whence curl > /dev/null && curl -L -s --max-time 3 -I ${REMOTE} || return 0