Created
April 23, 2012 13:15
-
-
Save jeanpimentel/2470856 to your computer and use it in GitHub Desktop.
curl -L git.io/github.sh | bash
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
#!/bin/bash | |
BASE_DIR="$(pwd)"; | |
OWNER="${1}"; | |
if [ "${OWNER}" == "" ]; | |
then | |
OWNER=${USER} | |
fi; | |
curl -L "https://api.github.com/users/${OWNER}/repos" | grep '"name"' | cut -d \" -f 4 | while read repository; | |
do | |
directory="${OWNER}/${repository}"; | |
echo -e "\033[32mWorking on ${directory}\033[0m"; | |
if [ ! -d "${BASE_DIR}/${directory}" ]; | |
then | |
mkdir -p "${BASE_DIR}/${directory}" | |
git clone "git@github.com:${directory}.git" "${BASE_DIR}/${directory}"; | |
fi; | |
cd "${BASE_DIR}/${directory}"; | |
git pull | |
git status -s | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment