Skip to content

Instantly share code, notes, and snippets.

@DuaelFr
Created September 4, 2015 23:00
Show Gist options
  • Save DuaelFr/9a1185ffccd0b539145d to your computer and use it in GitHub Desktop.
Save DuaelFr/9a1185ffccd0b539145d to your computer and use it in GitHub Desktop.
Script to generate patches for updating all drupal core dependencies
cd core; for dep in `composer info -iN`; do composer update $dep; git add -A .; git diff -M --cached > update-dep--${dep//\//--}.patch; git reset HEAD .; git checkout .; git clean -fd .; done; find . -size 0 -name "update-dep--*.patch" -exec rm -r {} \;
#!/bin/bash
cd core
for dep in `composer info -iN`
do
# Update dependency.
composer update $dep
# Make the patch.
git add -A .
git diff -M --cached > update-dep--${dep//\//--}.patch
# Clean up for the next round
git reset HEAD .
git checkout .
git clean -fd .
done
# Clean up empty patches for dependencies that have not been updated.
find . -size 0 -name "update-dep--*.patch" -exec rm -r {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment