Renamed a couple of variables

pull/974/head
Nils Winkler 2017-05-26 08:42:21 +02:00
parent 15868b1b61
commit 0039534517
1 changed files with 8 additions and 8 deletions

View File

@ -345,19 +345,19 @@ _enable-thing ()
typeset f $file_type typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash for f in $BASH_IT/$subdirectory/available/*.bash
do do
plugin=$(basename $f .$file_type.bash) to_enable=$(basename $f .$file_type.bash)
_enable-thing $subdirectory $file_type $plugin $load_priority _enable-thing $subdirectory $file_type $to_enable $load_priority
done done
else else
typeset plugin=$(command ls $BASH_IT/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1) typeset to_enable=$(command ls $BASH_IT/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then if [ -z "$to_enable" ]; then
printf '%s\n' "sorry, $file_entity does not appear to be an available $file_type." printf '%s\n' "sorry, $file_entity does not appear to be an available $file_type."
return return
fi fi
plugin=$(basename $plugin) to_enable=$(basename $to_enable)
# Check for existence of the file using a wildcard, since we don't know which priority might have been used when enabling it. # Check for existence of the file using a wildcard, since we don't know which priority might have been used when enabling it.
typeset enabled_plugin=$(command ls $BASH_IT/$subdirectory/enabled/{[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$plugin,$plugin} 2>/dev/null | head -1) typeset enabled_plugin=$(command ls $BASH_IT/$subdirectory/enabled/{[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$to_enable,$to_enable} 2>/dev/null | head -1)
if [ ! -z "$enabled_plugin" ] ; then if [ ! -z "$enabled_plugin" ] ; then
printf '%s\n' "$file_entity is already enabled." printf '%s\n' "$file_entity is already enabled."
return return
@ -366,10 +366,10 @@ _enable-thing ()
mkdir -p $BASH_IT/$subdirectory/enabled mkdir -p $BASH_IT/$subdirectory/enabled
# Load the priority from the file if it present there # Load the priority from the file if it present there
local local_file_priority=$(grep -E "^# BASH_IT_LOAD_PRIORITY:" $BASH_IT/$subdirectory/available/$plugin | awk -F': ' '{ print $2 }') local local_file_priority=$(grep -E "^# BASH_IT_LOAD_PRIORITY:" $BASH_IT/$subdirectory/available/$to_enable | awk -F': ' '{ print $2 }')
local use_load_priority=${local_file_priority:-$load_priority} local use_load_priority=${local_file_priority:-$load_priority}
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$use_load_priority$BASH_IT_LOAD_PRIORITY_SEPARATOR$plugin ln -s ../available/$to_enable $BASH_IT/$subdirectory/enabled/$use_load_priority$BASH_IT_LOAD_PRIORITY_SEPARATOR$to_enable
fi fi
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then