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

Commit

Permalink
Fix broken sed expression and #20
Browse files Browse the repository at this point in the history
Separates  removing the `ssh://` and `git@` prefixes into two expressions. Additionally, replaces `:` with `/`.

This means the initial `$GIT_REPO`  variable can be something like `[email protected]:my-org/my-repo` and still be cloned by this function, avoiding `URL using bad/illegal format or missing URL` errors.
  • Loading branch information
edshelton committed Jan 2, 2020
1 parent b577de0 commit 954e009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hrval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function clone {
ORIGIN=$(git rev-parse --show-toplevel)
GIT_REPO=$(yq r ${1} spec.chart.git)
if [[ -n "${GITHUB_TOKEN}" ]]; then
BASE_URL=$(echo "${GIT_REPO}" | sed 's/ssh:\/\/git@//')
BASE_URL=$(echo "${GIT_REPO}" | sed -e 's/ssh:\/\///' -e 's/git@//' -e 's/:/\//')
GIT_REPO="https://${GITHUB_TOKEN}:x-oauth-basic@${BASE_URL}"
fi
GIT_REF=$(yq r ${1} spec.chart.ref)
Expand Down

0 comments on commit 954e009

Please sign in to comment.