Created
May 25, 2018 15:43
-
-
Save Psycojoker/241382c743300c9879e6039f81bb637a 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 | |
BIN_PATH=ve/bin/git-of-theseus-analyze | |
if [ ! "$1" ] | |
then | |
echo "Usage: bash analyze.sh repos_list_file" | |
exit | |
fi | |
set -eux | |
OUTDIR=${1}_data | |
if [ ! -e $BIN_PATH ] | |
then | |
virtualenv ve | |
pip install -r ./requirements.txt | |
fi | |
mkdir -p $OUTDIR | |
all_cohorts="" | |
all_authors="" | |
all_exts="" | |
all_survival="" | |
for i in $(cat $1) | |
do | |
if [ -e $i ] | |
then | |
cd $i | |
git up | |
cd - | |
else | |
git clone https://github.com/yunohost/$i | |
fi | |
mkdir -p $i/charts | |
cd $i | |
branch_name="$(git branch | grep "^* " | sed 's/..//')" | |
git filter-branch -f --env-filter "$(cat ../uniformize_author_names.sh)" | |
cd - | |
git-of-theseus-analyze --branch=$branch_name --outdir=$i/charts $i | |
git-of-theseus-stack-plot --outfile=$OUTDIR/cohorts_$i.png $i/charts/cohorts.json | |
git-of-theseus-stack-plot --outfile=$OUTDIR/cohorts_${i}_normalize.png --normalize $i/charts/cohorts.json | |
all_cohorts="$all_cohorts $i/charts/cohorts.json" | |
git-of-theseus-stack-plot --outfile=$OUTDIR/exts_$i.png $i/charts/exts.json | |
git-of-theseus-stack-plot --outfile=$OUTDIR/exts_${i}_normalize.png --normalize $i/charts/exts.json | |
all_exts="$all_exts $i/charts/exts.json" | |
git-of-theseus-stack-plot --outfile=$OUTDIR/authors_$i.png $i/charts/authors.json | |
git-of-theseus-stack-plot --outfile=$OUTDIR/authors_${i}_normalize.png --normalize $i/charts/authors.json | |
all_authors="$all_authors $i/charts/authors.json" | |
git-of-theseus-survival-plot --outfile=$OUTDIR/survival_$i.png $i/charts/survival.json | |
all_survival="$all_survival $i/charts/survival.json" | |
done | |
git-of-theseus-survival-plot --outfile=$OUTDIR/survival_all.png $all_survival |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment