spam-ascii: pass -L to find so it dereferences ~/ascii when symlinked
Some checks failed
Close stale issues / stale (push) Has been cancelled
Some checks failed
Close stale issues / stale (push) Has been cancelled
~/ascii is a symlink to ~/.yadr/ascii. Without -L, 'find <symlink>' treats the link itself as the starting point, -type f rules it out, and fuzzy matches return nothing.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user