From 375515cc6e8e6d3439a3f72bfdfdde96b067f3ab Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Fri, 15 Sep 2017 08:10:14 +0200 Subject: [PATCH] Use compgen -G instead of ls for finding enabled components Reference: https://stackoverflow.com/a/34195247/1228454 --- lib/helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index c275459f..d736e96d 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -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