Use compgen -G instead of ls for finding enabled components

Reference: https://stackoverflow.com/a/34195247/1228454
pull/1043/head
Nils Winkler 2017-09-15 08:10:14 +02:00
parent 7242cc0927
commit 375515cc6e
1 changed files with 1 additions and 1 deletions

View File

@ -404,7 +404,7 @@ _enable-thing ()
return
fi
typeset enabled_plugin_global=$(command ls "${BASH_IT}/enabled/"[0-9][0-9][0-9]$BASH_IT_LOAD_PRIORITY_SEPARATOR$to_enable 2>/dev/null | head -1)
typeset enabled_plugin_global=$(command compgen -G "${BASH_IT}/enabled/[0-9][0-9][0-9]$BASH_IT_LOAD_PRIORITY_SEPARATOR$to_enable" 2>/dev/null | head -1)
if [ ! -z "$enabled_plugin_global" ] ; then
printf '%s\n' "$file_entity is already enabled."
return