Checking for global directory when looking for components that are not enabled

This commit is contained in:
Nils Winkler
2017-09-15 08:10:15 +02:00
parent 752d4afe41
commit a925f5d58c
2 changed files with 7 additions and 3 deletions

View File

@@ -12,7 +12,10 @@ _bash-it-comp-list-available-not-enabled()
local available_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort`;
do
if [ ! -e "${BASH_IT}/$subdirectory/enabled/"$(basename $f) ] && [ ! -e "${BASH_IT}/$subdirectory/enabled/"*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $f) ]
# TODO Find a better way to check for these, without using -e + glob
if [ ! -e "${BASH_IT}/$subdirectory/enabled/"$(basename $f) ] \
&& [ ! -e "${BASH_IT}/$subdirectory/enabled/"*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $f) ] \
&& [ ! -e "${BASH_IT}/enabled/"*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $f) ]
then
basename $f | cut -d'.' -f1
fi
@@ -25,6 +28,7 @@ _bash-it-comp-list-enabled()
{
subdirectory="$1"
# TODO Check for global directory as well
local enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/enabled/*.bash" | sort`;
do
basename $f | cut -d'.' -f1 | sed -e "s/^[0-9]*---//g"