mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
fixup when remote is set to git protocol
This commit is contained in:
parent
f48c36d85d
commit
6afbbe88c8
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue