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.
Buddy Sandidge 5 years ago
parent 07cc4dd5f8
commit 7fa6ac9318

@ -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

@ -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 "$@" {} \;
}

Loading…
Cancel
Save