Fix vault_search.sh: move rg -g glob filters before --
Placing -g after -- made ripgrep treat the filters as literal positional paths instead of options, so the .obsidian/.git/*.md exclusions were silently inert (confirmed: matched inside a .pdf).
This commit is contained in:
@@ -52,8 +52,8 @@ echo "== Search root: $SEARCH_ROOT =="
|
||||
echo
|
||||
|
||||
if command -v rg >/dev/null 2>&1; then
|
||||
rg -i -n --fixed-strings -- "$QUERY" "$SEARCH_ROOT" \
|
||||
-g '!.obsidian' -g '!.git' -g '*.md' || echo "(no matches)"
|
||||
rg -i -n --fixed-strings -g '!.obsidian' -g '!.git' -g '*.md' \
|
||||
-- "$QUERY" "$SEARCH_ROOT" || echo "(no matches)"
|
||||
else
|
||||
grep -ril -- "$QUERY" "$SEARCH_ROOT" --include='*.md' 2>/dev/null || echo "(no matches)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user