Created
February 21, 2019 22:41
-
-
Save bryanmr/b8aa475cc154cadebfcdfaad7b15529b to your computer and use it in GitHub Desktop.
Failed experiment with generating patches
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
#!/bin/bash | |
if [ "$1" == "--patcher" ] ; then | |
find diffs/ -type f -exec patch {} {} ';' | |
elif [ "$1" == "--diff" ] ; then | |
rm -rf diffs~ | |
mv diffs diffs~ | |
diff -r mediumish-theme-jekyll/ dist/ | grep -v '^Only in' |\ | |
awk '/^diff -r / { gather=1 ; | |
target=$4 ; | |
system("mkdir -p diffs/\"$(dirname " $4 ")\"") ; | |
next } | |
gather{ print >> "diffs/"target }' | |
echo "Produced differences:" | |
rm -f diffs/dist/_config.yml diffs/dist/Gemfile.lock | |
find diffs/ -type f | |
else | |
echo "Unknown option" | |
echo "Run either with --patcher or --diff" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment