Last active
December 24, 2015 09:37
-
-
Save jeswin/893595e01575d5031c3d 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 | |
mkdir -p repos | |
cd repos | |
runtask() { | |
curdir=`pwd` | |
git_url=$1 | |
cmd_after_clone=$2 | |
declare -a projects=("${!3}") #don't we just love bash arrays? | |
for proj in "${projects[@]}" | |
do | |
if [ ! -d $proj ]; then | |
echo cloning ${git_url}/${proj}... | |
git clone $git_url/$proj | |
cd $proj | |
eval $cmd_after_clone | |
cd $curdir | |
else | |
echo $proj exists, skipped. | |
fi | |
done | |
} | |
echo Git Clone | |
echo ========= | |
github="http://www.github.com/jeswin" #no trailing slash please. | |
my_projects=( | |
"crankshaft" | |
"ceramic" | |
"fora" | |
"isotropy" | |
"isotropy-mount" | |
"isotropy-static" | |
"isotropy-router" | |
"isotropy-plugin-react" | |
"isotropy-adapter-react" | |
"isotropy-adapter-react-browser" | |
"isotropy-plugin-graphql" | |
"isotropy-plugin-webapp" | |
"isotropy-plugin-static" | |
"isotropy-backend-mongodb" | |
"isotropy-backend-nedb" | |
"nedb-isotropy" | |
"nodefunc-promisify" | |
"nodefunc-generatorify" | |
) | |
after_cloning='npm i' | |
runtask $github "$after_cloning" my_projects[@] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment