Created
July 6, 2012 22:59
-
-
Save jimblandy/3063226 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Like find, but automatically ignore Mercurial metadata and build trees | |
# Skip initial path arguments, so we can insert our magic at the start | |
# of the options. | |
paths=() | |
while case "${1--}" in (-* | !) false;; (*) true;; esac do | |
paths=("${paths[@]}" "$1") | |
shift | |
done | |
exec find "${paths[@]}" \ | |
'(' -name .hg -o -name 'obj-*' -o -name 'obj~' ')' -prune \ | |
-o "${@--true}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment