From caced3b65f95febfeac0683c5b5eb7bec577da78 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Tue, 9 Jun 2020 12:36:06 +0200 Subject: [PATCH 1/3] Using $() instead of backticks to make shellcheck happy --- themes/base.theme.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 44ccb402..86024beb 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -83,10 +83,10 @@ RBENV_THEME_PROMPT_SUFFIX='|' RBFU_THEME_PROMPT_PREFIX=' |' RBFU_THEME_PROMPT_SUFFIX='|' -GIT_EXE=`which git 2> /dev/null || true` -P4_EXE=`which p4 2> /dev/null || true` -HG_EXE=`which hg 2> /dev/null || true` -SVN_EXE=`which svn 2> /dev/null || true` +GIT_EXE=$(which git 2> /dev/null || true) +P4_EXE=$(which p4 2> /dev/null || true) +HG_EXE=$(which hg 2> /dev/null || true) +SVN_EXE=$(which svn 2> /dev/null || true) function scm { if [[ "$SCM_CHECK" = false ]]; then SCM=$SCM_NONE From 2ba3797da6d59529c7a12cdf5199c560b3ed69ee Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Tue, 9 Jun 2020 14:05:48 +0200 Subject: [PATCH 2/3] Added check for SVN not available --- themes/base.theme.bash | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 86024beb..4418d881 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -88,6 +88,15 @@ P4_EXE=$(which p4 2> /dev/null || true) HG_EXE=$(which hg 2> /dev/null || true) SVN_EXE=$(which svn 2> /dev/null || true) +# Check for broken SVN exe that is caused by some versions of Xcode. +# See https://github.com/Bash-it/bash-it/issues/1612 for more details. +if [[ -x "$SVN_EXE" ]] ; then + if "$SVN_EXE" 2>&1 | grep -q "subversion command line tools are no longer provided" ; then + # Unset the SVN exe variable so that SVN commands are avoided. + SVN_EXE="" + fi +fi + function scm { if [[ "$SCM_CHECK" = false ]]; then SCM=$SCM_NONE elif [[ -f .git/HEAD ]] && [[ -x "$GIT_EXE" ]]; then SCM=$SCM_GIT From 47512a1624c5d968ce4b990223cc933a2b663961 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Sun, 14 Jun 2020 19:31:25 +0200 Subject: [PATCH 3/3] Checking for SVN return code --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 4418d881..97bbee45 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -91,7 +91,7 @@ SVN_EXE=$(which svn 2> /dev/null || true) # Check for broken SVN exe that is caused by some versions of Xcode. # See https://github.com/Bash-it/bash-it/issues/1612 for more details. if [[ -x "$SVN_EXE" ]] ; then - if "$SVN_EXE" 2>&1 | grep -q "subversion command line tools are no longer provided" ; then + if ! "$SVN_EXE" --version > /dev/null 2>&1 ; then # Unset the SVN exe variable so that SVN commands are avoided. SVN_EXE="" fi