Skip to content

Instantly share code, notes, and snippets.

@bryanmr
Created February 21, 2019 22:41
Show Gist options
  • Save bryanmr/b8aa475cc154cadebfcdfaad7b15529b to your computer and use it in GitHub Desktop.
Save bryanmr/b8aa475cc154cadebfcdfaad7b15529b to your computer and use it in GitHub Desktop.
Failed experiment with generating patches
#!/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