lib/utilities: fix `_bash-it-get-component-type-from-path()`

Account for plugins with names that contain periods.
pull/1933/head
John D Pell 2021-09-21 23:25:02 -07:00
parent 44ddd3936d
commit fe102ff505
1 changed files with 3 additions and 2 deletions

View File

@ -16,13 +16,14 @@ _bash-it-get-component-name-from-path() {
} }
_bash-it-get-component-type-from-path() { _bash-it-get-component-type-from-path() {
local filename
# filename without path # filename without path
filename="${1##*/}" filename="${1##*/}"
# filename without extension # filename without extension
filename="${filename%.bash}" filename="${filename%.bash}"
# extension without priority or name # extension without priority or name
#filename="${filename#*.}" filename="${filename##*.}"
echo "${filename#*.}" #| cut -d '.' -f 2 echo "${filename}"
} }
# This function searches an array for an exact match against the term passed # This function searches an array for an exact match against the term passed