3 # this script makes symlinks to git project directories which are in ~/src,
4 # and place these symlinks in directories names after the git project's author,
5 # which is generally the github owner's username.
13 if [ -d "$repo/.git" ]
15 for remote
in github github.com origin
17 remote_url
=`GIT_DIR=$repo/.git git remote get-url "$remote" 2>/dev/null`
18 if [ -n "$remote_url" ]
20 if [[ $remote_url =~
[/:]([^
/]+)/([^
/]+)/?$
]]
22 author
=${BASH_REMATCH[1]}
29 [ -d "$author" ] || mkdir
"$author"
30 ln -snfr "$repo" "$author/"
32 echo "unknown author of $repo" >&2