commit 6cba32c265a0089e11ff6aff7f0ae2363a2dd545
parent 7d7a2162cf93f0c4711326ea64cb6f3d50c9dd3c
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date: Sat, 29 Nov 2025 22:37:37 +0000
Unneeded internal function `glob_exists` is removed
Diffstat:
2 files changed, 0 insertions(+), 29 deletions(-)
diff --git a/spec/internal_spec.sh b/spec/internal_spec.sh
@@ -140,20 +140,6 @@ Describe 'Internal Helper Functions'
The status should equal 1
End
- Describe 'glob_exists'
- It 'answers y when the glob matches something'
- When call glob_exists /*
- The status should be success
- The variable ANSWER should equal y
- End
-
- It 'answers n when the glob does not match anything'
- When call glob_exists non-existent/*
- The status should be success
- The variable ANSWER should equal n
- End
- End
-
Describe 'set_LOCAL_RECIPIENT_FILE'
PREFIX="${SHELLSPEC_WORKDIR}/prefix/store"
setup() {
diff --git a/src/pashage.sh b/src/pashage.sh
@@ -61,17 +61,6 @@ die() {
exit 1
}
-# Checks whether a globs expands correctly
-# This lets the shell expand the glob as an argument list, and counts on
-# the glob being passed unchanged as $1 otherwise.
-glob_exists() {
- if [ -e "$1" ]; then
- ANSWER=y
- else
- ANSWER=n
- fi
-}
-
# Always-successful grep filter
# ... grep arguments
grep_filter() {
@@ -714,10 +703,6 @@ do_generate_show() {
# $1: current subdirectory name
# ... grep arguments
do_grep() {
- glob_exists "$1"/*
- [ "${ANSWER}" = y ] || return 0
- unset ANSWER
-
for ARG in "$1"/*; do
if [ -d "${ARG}" ]; then
shift