Created
May 15, 2020 17:42
-
-
Save saml/c56f5ba5c28a408febcebf54d5dcb94c 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
#!/bin/bash | |
REPOS=(foo bar) | |
git_up() { | |
if (( $# > 0 )) | |
then | |
repos=$@ | |
else | |
repos=${REPOS[@]} | |
fi | |
for repo in "${repos[@]}" | |
do | |
cd "$repo" | |
git pull --rebase | |
done | |
} | |
cmd="$1" | |
shift 1 | |
case "$cmd" | |
in | |
git_up) | |
git_up "$@" | |
;; | |
*) | |
echo "Usage: $0 git_up [projects...]" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment