diff --git a/.local/bin/spam-ascii b/.local/bin/spam-ascii index 19b3067e..f4a11162 100755 --- a/.local/bin/spam-ascii +++ b/.local/bin/spam-ascii @@ -32,8 +32,10 @@ for candidate in \ fi done -# 3. First case-insensitive substring match. -match=$(find "$dir" -maxdepth 1 -type f -iname "*$pattern*" 2>/dev/null \ +# 3. First case-insensitive substring match. -L so find follows a possible +# symlink starting point (e.g. ~/ascii -> ~/.yadr/ascii); without it, find +# treats the symlink itself as the "starting point" and ignores -type f. +match=$(find -L "$dir" -maxdepth 1 -type f -iname "*$pattern*" 2>/dev/null \ | sort \ | head -n1)