This commit is contained in:
@@ -5,27 +5,8 @@ set -euo pipefail
|
||||
# This file is intended to be run in CI and locally.
|
||||
|
||||
determine_repo_web_base() {
|
||||
local origin_url
|
||||
origin_url="$(git config --get remote.origin.url || true)"
|
||||
if [[ -z "${origin_url}" ]]; then
|
||||
echo "Error: could not determine git remote origin URL" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local web_base
|
||||
if [[ "${origin_url}" =~ ^https?:// ]]; then
|
||||
web_base="${origin_url%.git}"
|
||||
elif [[ "${origin_url}" =~ ^git@([^:]+):(.+)\.git$ ]]; then
|
||||
local host path
|
||||
host="${BASH_REMATCH[1]}"
|
||||
path="${BASH_REMATCH[2]}"
|
||||
web_base="https://${host}/${path}"
|
||||
else
|
||||
# Fallback: strip trailing .git if present
|
||||
web_base="${origin_url%.git}"
|
||||
fi
|
||||
|
||||
printf '%s' "${web_base}"
|
||||
# Use hardcoded base URL
|
||||
printf '%s' "https://git.hudsonriggs.systems/HRiggs/Tools"
|
||||
}
|
||||
|
||||
determine_branch() {
|
||||
|
||||
Reference in New Issue
Block a user