Skip to content

Commit

Permalink
Add 'find-git-repos'
Browse files Browse the repository at this point in the history
  • Loading branch information
za3k committed Apr 24, 2016
1 parent 19c59e9 commit fc43d79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ filter
---
Usage: `cat <stream | filter --negative FILENAME` blacklists anything in FILENAME, there are options for whitelisting and dealing with repeats.

find-git-repos
---
Usage: `find-git-repos DIRECTORY` prints all git repositories found, one per line.

fragile-treediff
---
Usage: `fragile-treediff FOLDER1 FOLDER2`
Expand Down
15 changes: 15 additions & 0 deletions find-git-repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

usage() {
echo "Usage: find-git-repos DIRECTORY"
}

if [ $# -ne 1 ]
then
usage;
exit 1
fi

DIRECTORY="$(realpath "$1")"; shift

find ${DIRECTORY} -type d -name '.git' -printf '%h\n' # %h is 'dirname <file>'

0 comments on commit fc43d79

Please sign in to comment.