From fe102ff5055655ab2a38ee9bb3d0ac40fc1347b6 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 21 Sep 2021 23:25:02 -0700 Subject: [PATCH] lib/utilities: fix `_bash-it-get-component-type-from-path()` Account for plugins with names that contain periods. --- lib/utilities.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/utilities.bash b/lib/utilities.bash index 60b80376..d919004f 100644 --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -16,13 +16,14 @@ _bash-it-get-component-name-from-path() { } _bash-it-get-component-type-from-path() { + local filename # filename without path filename="${1##*/}" # filename without extension filename="${filename%.bash}" # extension without priority or name - #filename="${filename#*.}" - echo "${filename#*.}" #| cut -d '.' -f 2 + filename="${filename##*.}" + echo "${filename}" } # This function searches an array for an exact match against the term passed