Skip to content

Commit

Permalink
Merge pull request #848 from hippietrail/just-searchfor-grep-fallback
Browse files Browse the repository at this point in the history
fix: fall back to `grep` when `rg` is not available
  • Loading branch information
elijah-potter authored Mar 8, 2025
2 parents ab92b31 + 0b3f1f0 commit afde1db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,12 @@ addnoun noun:

# Search Harper's curated dictionary for a specific word
searchdictfor word:
cargo run --bin harper-cli -- words | rg {{word}}
#! /bin/bash
if command -v rg > /dev/null; then
cargo run --bin harper-cli -- words | rg {{word}}
else
cargo run --bin harper-cli -- words | grep {{word}}
fi

# Find words in the user's `harper-ls/dictionary.txt` for words already in the curated dictionary.
userdictoverlap:
Expand Down

0 comments on commit afde1db

Please sign in to comment.