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
|
echo
|
||||||
|
|
||||||
if command -v rg >/dev/null 2>&1; then
|
if command -v rg >/dev/null 2>&1; then
|
||||||
rg -i -n --fixed-strings -- "$QUERY" "$SEARCH_ROOT" \
|
rg -i -n --fixed-strings -g '!.obsidian' -g '!.git' -g '*.md' \
|
||||||
-g '!.obsidian' -g '!.git' -g '*.md' || echo "(no matches)"
|
-- "$QUERY" "$SEARCH_ROOT" || echo "(no matches)"
|
||||||
else
|
else
|
||||||
grep -ril -- "$QUERY" "$SEARCH_ROOT" --include='*.md' 2>/dev/null || echo "(no matches)"
|
grep -ril -- "$QUERY" "$SEARCH_ROOT" --include='*.md' 2>/dev/null || echo "(no matches)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user