Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
fix: strip .git off url properly
Browse files Browse the repository at this point in the history
`basename` is too aggressive and removes the hostname and path.
  • Loading branch information
docwhat committed Sep 24, 2020
1 parent 24972b5 commit 5e27efb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hrval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ function clone {
CHART_GIT_REPO=$(yq r ${1} spec.chart.git)
RELEASE_GIT_REPO=$(git remote get-url origin)

CHART_BASE_URL=$(basename $(echo "${CHART_GIT_REPO}" | sed -e 's/ssh:\/\///' -e 's/http:\/\///' -e 's/https:\/\///' -e 's/git@//' -e 's/:/\//') .git )
RELEASE_BASE_URL=$(basename $(echo "${RELEASE_GIT_REPO}" | sed -e 's/ssh:\/\///' -e 's/http:\/\///' -e 's/https:\/\///' -e 's/git@//' -e 's/:/\//') .git )
CHART_BASE_URL=$(echo "${CHART_GIT_REPO}" | sed -e 's/ssh:\/\///' -e 's/http:\/\///' -e 's/https:\/\///' -e 's/git@//' -e 's/:/\//' -e 's/\.git$//')
RELEASE_BASE_URL=$(echo "${RELEASE_GIT_REPO}" | sed -e 's/ssh:\/\///' -e 's/http:\/\///' -e 's/https:\/\///' -e 's/git@//' -e 's/:/\//' -e 's/\.git$//')

if [[ -n "${GITHUB_TOKEN}" ]]; then
CHART_GIT_REPO="https://${GITHUB_TOKEN}:x-oauth-basic@${CHART_BASE_URL}"
Expand Down

0 comments on commit 5e27efb

Please sign in to comment.