commit cce0a21e52ad241866bfd2fc1c680108954d6398 parent c2b795e6881d34617a812465bf10a2b5ff759280 Author: Natasha Kerensikova <natgh@instinctive.eu> Date: Wed, 5 Nov 2025 20:21:45 +0000 Extension removal in `find` command is corrected Diffstat:
| M | spec/action_spec.sh | | | 6 | ++++++ |
| M | spec/pashage_extra_spec.sh | | | 8 | ++++++++ |
| M | src/pashage.sh | | | 2 | +- |
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/spec/action_spec.sh b/spec/action_spec.sh @@ -2228,6 +2228,12 @@ Describe 'Action Functions' The output should equal "$(result)" End + It 'does not consider file extension when matching' + When call do_tree "${PREFIX}" 'Title' g + The status should be success + The output should equal '' + End + It 'might not display anything' When call do_tree "${PREFIX}" 'Title' z The status should be success diff --git a/spec/pashage_extra_spec.sh b/spec/pashage_extra_spec.sh @@ -632,6 +632,14 @@ Describe 'Integrated Command Functions' The error should be blank The result of function check_git_log should be successful End + + It 'does not consider file extension when matching' + When call cmd_find g + The status should be success + The output should equal 'Search pattern: g' + The error should be blank + The result of function check_git_log should be successful + End End Describe 'cmd_generate' diff --git a/src/pashage.sh b/src/pashage.sh @@ -1081,7 +1081,7 @@ do_tree_item() { fi elif [ "${ITEM_NAME%.gpg}.gpg" = "${ITEM_NAME}" ]; then if [ $# -eq 0 ] \ - || printf '%s\n' "${ITEM_NAME%.age}" | grep -q "$@" + || printf '%s\n' "${ITEM_NAME%.gpg}" | grep -q "$@" then printf '%s\n' \ "${RED_TEXT}${ITEM_NAME%.gpg}${NORMAL_TEXT}"