Update deepgrep from alias to function

The latest version of macOS did not play well with the version of
deepgrep that piped find to xargs. Replaced it with version to use exec
feature of find.
This commit is contained in:
Buddy Sandidge 2020-01-24 12:55:07 -08:00
parent 07cc4dd5f8
commit 7fa6ac9318
2 changed files with 10 additions and 1 deletions

View File

@ -55,7 +55,6 @@ alias can-haz='sudo apt-get install '
alias take='sudo chown $(whoami):$(whoami) '
alias simple-http-server='python3 -m http.server'
alias numfiles='find . -maxdepth 1 -type f | wc -l'
alias deepgrep='find . -type d -name "node_modules" -prune -o -type f -not -name "*.swp" -not -name "*.pyc" | sed "s/$/\"/g" | sed "s/^/\"/g" | xargs grep --color '
alias slugify="sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z"
# Show list of git branches

View File

@ -28,3 +28,13 @@ function add-date-prefix {
function get-bitrate {
exiftool -AudioBitrate "$1" | awk '{print $4}'
}
function deepgrep {
find . \
-type d -name node_modules -prune -o \
-type d -name .git -prune -o \
-type f \
-not -name "*.swp" \
-not -name "*.pyc" \
-exec grep --with-filename --color "$@" {} \;
}