Merge pull request #1748 from NoahGorny/fix-git-url-in-bashit-version

version: Fix url in case it is ssh based one
pull/1757/head
Noah Gorny 2020-12-28 21:35:53 +02:00 committed by GitHub
commit a1da0087a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -346,6 +346,11 @@ _bash-it-version() {
BASH_IT_GIT_REMOTE=$(git remote get-url $BASH_IT_REMOTE)
BASH_IT_GIT_URL=${BASH_IT_GIT_REMOTE%.git}
if [[ "$BASH_IT_GIT_URL" == *"git@"* ]]; then
# Fix URL in case it is ssh based URL
BASH_IT_GIT_URL=${BASH_IT_GIT_URL/://}
BASH_IT_GIT_URL=${BASH_IT_GIT_URL/git@/https://}
fi
current_tag=$(git describe --exact-match --tags 2> /dev/null)