Created
May 22, 2020 15:05
-
-
Save mhanberg/038775b44e786ac29de09a8bda3a7ba5 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
| # cd into every dir in my ~/Development folder | |
| # determine if a repo is from my work's GitHub org | |
| # set my git user email with my work email | |
| # cd back out | |
| for dir in $(ls); do | |
| cd "$dir" | |
| is_work=$(git remote get-url --push origin | awk '/[email protected]:github-org\//{print 1}') | |
| if [ -n "$is_work" ]; then | |
| git config user.email "[email protected]" | |
| fi | |
| cd .. | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't seem to work if the directory name has a space it.