[update.sh] New test with protection of Homebrew directory

This commit is contained in:
Sharon Azriel 2024-01-22 09:47:47 +02:00
parent 807b3e3394
commit a1fbbc323a

View File

@ -637,10 +637,11 @@ EOS
then
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY_URL#https://github.com/}"
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY%.git}"
elif [[ "${UPSTREAM_REPOSITORY_URL}" =~ https://(([^:@]+)(:([^@]+))?@)?github.com/(.*)$ ]]
elif [[ "${DIR}" != "${HOMEBREW_REPOSITORY}" ]] &&
[[ "${UPSTREAM_REPOSITORY_URL}" =~ https://([[:alnum:]_:]+)@github.com/(.*)$ ]]
then
UPSTREAM_REPOSITORY="${BASH_REMATCH[5]%.git}"
UPSTREAM_REPOSITORY_TOKEN="${BASH_REMATCH[4]:-${BASH_REMATCH[2]}}"
UPSTREAM_REPOSITORY="${BASH_REMATCH[2]%.git}"
UPSTREAM_REPOSITORY_TOKEN="${BASH_REMATCH[1]#*:}"
fi
if [[ -n "${UPSTREAM_REPOSITORY}" ]]