]> git.plutz.net Git - shellwiki/commitdiff
avoid nonexitent globs in attachment_glob() (i.e. foo-*.bar)
authorPaul Hänsch <paul@plutz.net>
Tue, 6 Jun 2023 22:28:45 +0000 (00:28 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 6 Jun 2023 22:28:45 +0000 (00:28 +0200)
tools.sh

index b714ec6efcc9c6a0d6b032ec60b46ab22179c2c2..6388e3f3219b53c36fadf39511c9d88990fefd87 100755 (executable)
--- a/tools.sh
+++ b/tools.sh
@@ -83,6 +83,7 @@ attachment_glob(){
   esac \
   | sort -u \
   | while read -r glob; do
+    [ -e "$glob" ] || continue
     pagedir="$(page_abs "${glob%%/#attachments/*}/")"
     [ -d "$_DATA/pages/$pagedir" -o -d "$_EXEC/pages/$pagedir" ] \
     && printf '%s\n' "${glob%%/#attachments/*}/${glob#*/#attachments/}"