version: Fix url in case it is ssh based one

pull/1748/head
Noah Gorny 2020-12-17 01:23:02 +02:00
parent 501b1ab3b5
commit 6914a2345a
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)