From 6914a2345a48317ef9779120d6c8cfef81363eb4 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Thu, 17 Dec 2020 01:23:02 +0200 Subject: [PATCH] version: Fix url in case it is ssh based one --- lib/helpers.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/helpers.bash b/lib/helpers.bash index 270a31b9..436fc59e 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -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)