Created
April 26, 2020 16:43
-
-
Save crkrenn/1223e02d171175ad2a363ea13604c659 to your computer and use it in GitHub Desktop.
script to compare monorepo with master branches
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
set -e | |
# USAGE | |
# | |
# Copy this script into an empty repo, and run: | |
# | |
# $ bash merge-test.sh | |
# | |
# Git repos will be cloned into the dir containing the script. Re-running will delete dirs and re-run. | |
shopt -s extglob | |
shopt -s dotglob | |
OLD_REPOS=(polisServer polisMath polisClientAdmin polisClientParticipation polisReport) | |
NEW_DIRS=( server math client-admin client-participation report) | |
MONOREPO="polis" | |
echo "--- Removing previous polis repos..." | |
rm -rf $all_repos | |
rm -rf monorepo | |
for r in ${OLD_REPOS[@]}; do | |
echo "--- Cloning pol-is/$r..." | |
git clone --quiet https://github.com/pol-is/$r | |
done | |
echo "--- Cloning monorepo..." | |
git clone --quiet https://github.com/pol-is-trial-balloon/${MONOREPO} | |
for (( index=0; index<${#OLD_REPOS[*]}; ++index)); do | |
echo "diff -r -q ${OLD_REPOS[$index]} polis/${NEW_DIRS[$index]} " | |
diff -r -q ${OLD_REPOS[$index]} polis/${NEW_DIRS[$index]} \ | |
&& echo "" | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment