diff --git a/lib/helpers.bash b/lib/helpers.bash index ea37dac3..16b31946 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -223,7 +223,7 @@ _bash-it-describe () for f in "${BASH_IT}/$subdirectory/available/"*.bash do # Check for both the old format without the load priority, and the extended format with the priority - if [ -e "${BASH_IT}/$subdirectory/enabled/"$(basename $f) ] || [ -e "${BASH_IT}/$subdirectory/enabled/"*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $f) ]; then + if [ -e "${BASH_IT}/enabled/"*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $f) ] || [ -e "${BASH_IT}/$subdirectory/enabled/"$(basename $f) ] || [ -e "${BASH_IT}/$subdirectory/enabled/"*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $f) ]; then enabled='x' else enabled=' ' diff --git a/test/lib/helpers.bats b/test/lib/helpers.bats index 14d45b0e..a3900963 100644 --- a/test/lib/helpers.bats +++ b/test/lib/helpers.bats @@ -388,6 +388,20 @@ function __migrate_all_components() { _bash-it-plugins | grep "nvm" | grep "\[x\]" } +@test "bash-it: describe the nvm plugin after enabling it in the old directory" { + ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash + assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ] + + _bash-it-plugins | grep "nvm" | grep "\[x\]" +} + +@test "bash-it: describe the nvm plugin after enabling it in the old directory with priority" { + ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/225---nvm.plugin.bash + assert [ -L "$BASH_IT/plugins/enabled/225---nvm.plugin.bash" ] + + _bash-it-plugins | grep "nvm" | grep "\[x\]" +} + @test "bash-it: describe the todo.txt-cli aliases without enabling them" { run _bash-it-aliases assert_line "todo.txt-cli [ ] todo.txt-cli abbreviations"