Skip to content

Commit

Permalink
populate
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 24, 2017
1 parent 3e7410f commit 3c0f021
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions metatool
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
set -e
set -x

org_name=`
git remote -v |
head -n 1 |
sed -r 's#^.*[:/]([^/]*)/_meta.*$#\1#'
`

manyrepos_dir=.many
manyrepos_branch=master
metarepo_branch=meta
Expand All @@ -15,6 +21,12 @@ init() {
done
}

populate() {
mkdir -p .many
find * -maxdepth 0 -type d |
parallel -I"{}" hub clone "${org_name}/{}" "${manyrepos_dir}/{}"
}

sync() {
ls $manyrepos_dir |
while read project
Expand All @@ -28,8 +40,8 @@ sync() {
check_merge $project
done

ls $manyrepos_dir | parallel -I"{}" echo git subtree push --prefix="{}" $manyrepos_dir/"{}" $metarepo_branch
ls $manyrepos_dir | parallel -I"{}" git subtree push --prefix="{}" $manyrepos_dir/"{}" $metarepo_branch
ls $manyrepos_dir |
parallel -I"{}" git subtree push --prefix="{}" $manyrepos_dir/"{}" $metarepo_branch

ls $manyrepos_dir |
while read project
Expand Down Expand Up @@ -101,6 +113,9 @@ case $command in
init)
init $@
;;
populate)
populate $@
;;
sync)
sync $@
;;
Expand Down

0 comments on commit 3c0f021

Please sign in to comment.