Created
August 10, 2015 22:04
-
-
Save beporter/2f4b35435f0107d7b330 to your computer and use it in GitHub Desktop.
Find all git repos (folders containing a `.git/` subdirectory) in the provided path (defaults to current directory.)
This file contains 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 | |
# | |
# Find and list all git repos (folders containing .git/ directories) | |
# in the provided path (defaults to current dir.) | |
# | |
# Designed to run on a Mac, so make sure you have GNU `findutils` | |
# and the `terminal-notifier` gem installed. | |
# | |
# [email protected] | |
# v1.0 2015-08-10 | |
SEARCH_PATH=${1:-"."} | |
echo "This could take a while. I'll notify you when done." 1>&2 | |
gfind "${SEARCH_PATH%/}" -name .git -type d -prune -not \( -path "*/vendor*" -prune \) -printf "%h\n" | |
terminal-notifier -sound default -message 'Git repo search complete. Check your Terminal window.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Throws an error if you use it in iTerm at least for me.
