Skip to content

Instantly share code, notes, and snippets.

@jeswin
Last active December 24, 2015 09:37
Show Gist options
  • Save jeswin/893595e01575d5031c3d to your computer and use it in GitHub Desktop.
Save jeswin/893595e01575d5031c3d to your computer and use it in GitHub Desktop.
#!/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