Disabling a single component will support both patterns

The old pattern with just the name (node.plugin.bash) and the new one
with the load priority (250---node.plugin.bash).
pull/974/head
Nils Winkler 2017-05-10 11:12:05 +02:00
parent dce0ac5b34
commit cc8621a888
1 changed files with 5 additions and 1 deletions

View File

@ -240,7 +240,11 @@ _disable-thing ()
fi fi
done done
else else
typeset plugin=$(command ls $BASH_IT/$subdirectory/enabled/$file_entity.*bash 2>/dev/null | head -1) # Use a glob to search for both possible patterns
# 250---node.plugin.bash
# node.plugin.bash
# Either one will be matched by this glob
typeset plugin=$(command ls $BASH_IT/$subdirectory/enabled/{[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity.*bash,$file_entity.*bash} 2>/dev/null | head -1)
if [ -z "$plugin" ]; then if [ -z "$plugin" ]; then
printf '%s\n' "sorry, $file_entity does not appear to be an enabled $file_type." printf '%s\n' "sorry, $file_entity does not appear to be an enabled $file_type."
return return