diff --git a/configure.ac b/configure.ac index 642b2bd..decdec4 100644 --- a/configure.ac +++ b/configure.ac @@ -101,17 +101,6 @@ AM_COND_IF([HAVE_BASH_PATH], [MULTI_BASH_HACK=data/bash/common/single-bash.sh]) AC_SUBST_FILE([MULTI_BASH_HACK]) -QH_ARG_ENABLE([scl], [no]) -AM_CONDITIONAL([ENABLE_SCL], [test "x$enable_scl" = xyes]) -AM_COND_IF([ENABLE_SCL], - [QH_REQUIRE_PROG([SCL], [scl], [path to scl]) - QH_REQUIRE_PROG([SCL_ENABLED], [scl_enabled], [path to scl_enabled]) - QH_REQUIRE_PROG([SCL_SOURCE], [scl_source], [path to scl_source]) - QH_VAR_ENSURE([SCL_LIST], - [software collections list], - [`$SCL --list`]) - AC_CONFIG_FILES([data/bash/common/profile.d/scl.sh])]) - # bash-completion not enabled by default on Darwin AM_COND_IF([HOST_OS_DARWIN], [QH_VAR_ENSURE([BASH_COMPLETION], @@ -334,6 +323,19 @@ AM_COND_IF([HOST_OS_DARWIN], [/usr/local]) AC_CONFIG_FILES([data/bash/common/homebrew-pathmung])]) +## software collections ## + +QH_ARG_ENABLE([scl], [no]) +AM_CONDITIONAL([ENABLE_SCL], [test "x$enable_scl" = xyes]) +AM_COND_IF([ENABLE_SCL], + [QH_REQUIRE_PROG([SCL], [scl], [path to scl]) + QH_REQUIRE_PROG([SCL_ENABLED], [scl_enabled], [path to scl_enabled]) + QH_REQUIRE_PROG([SCL_SOURCE], [scl_source], [path to scl_source]) + QH_VAR_ENSURE([SCL_LIST], + [software collections list], + [`$SCL --list`]) + AC_CONFIG_FILES([data/bash/common/profile.d/scl.sh])]) + ## systemd ## # check for systemd-path diff --git a/data/bash/common/profile.d/scl.sh.in b/data/bash/common/profile.d/scl.sh.in index 4e41b03..de1642b 100644 --- a/data/bash/common/profile.d/scl.sh.in +++ b/data/bash/common/profile.d/scl.sh.in @@ -6,5 +6,13 @@ if echo $- | grep i &> /dev/null; then if ! @SCL_ENABLED@ $scl; then source @SCL_SOURCE@ enable $scl fi + # source the bash-completion for any git software collection + if @GREP@ git <<<$scl &>/dev/null; then + completion=$(find /opt/rh/$scl -path '*/bash-completion/*git' 2>/dev/null) + if [[ -r $completion ]]; then + source $completion + fi + unset completion + fi done fi