Skip to content

Commit

Permalink
Merge pull request #16 from jakedsouza/master
Browse files Browse the repository at this point in the history
Fix check script for git uri's
  • Loading branch information
Tobi Fuhrimann committed Nov 8, 2017
2 parents cc9e86a + beb9228 commit 7bcab70
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/check
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ private_token="$(jq -r '.source.private_token // ""' < "${payload}")"
no_ssl="$(jq -r '.source.no_ssl // ""' < "${payload}")"
version_sha="$(jq -r '.version.sha // ""' < "${payload}")"

gitlab_host="$(echo "${uri}" | sed -rn 's/(https?):\/\/([^\/]*)\/(.*)\.git/\2/p')"
project_path="$(echo "${uri}" | sed -rn 's/(https?):\/\/([^\/]*)\/(.*)\.git/\3/p')"
protocol="$(echo "${uri}" | sed -rn 's/(https?):\/\/([^\/]*)\/(.*)\.git/\1/p')"
if [[ "${uri}" == "git@"* ]]; then
gitlab_host="$(echo "${uri}" | sed -rn 's/git@(.*):(.*)\.git/\1/p')"
project_path="$(echo "${uri}" | sed -rn 's/git@(.*):(.*)\.git/\2/p')"
protocol='https'
else
gitlab_host="$(echo "${uri}" | sed -rn 's/(https?):\/\/([^\/]*)\/(.*)\.git/\2/p')"
project_path="$(echo "${uri}" | sed -rn 's/(https?):\/\/([^\/]*)\/(.*)\.git/\3/p')"
protocol="$(echo "${uri}" | sed -rn 's/(https?):\/\/([^\/]*)\/(.*)\.git/\1/p')"
fi

if [ "${no_ssl}" == 'true' ]; then
protocol='http'
Expand Down

0 comments on commit 7bcab70

Please sign in to comment.