Newer
Older
#!/bin/bash
PATCHDIR=".patches"
apply_patches() {
for patch in "$PATCHDIR"/*; do
git -C "$(basename "$patch")" apply "../$patch"
done
}
create_patches() {
rm -f "$PATCHDIR"/*
git submodule foreach -q "git diff > ../$PATCHDIR/"'$name'
find "$PATCHDIR" -type f -empty -delete
}
if [ "$1" == "-c" ]; then
create_patches
else
apply_patches
fi