Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Created November 1, 2017 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadawais/b17ebcddbf4f3cb5dff36e9df2e38082 to your computer and use it in GitHub Desktop.
Save ahmadawais/b17ebcddbf4f3cb5dff36e9df2e38082 to your computer and use it in GitHub Desktop.
WP: Create WordPress Core Patch via Command Line
# Create a DIff/patch.
function wpcp() {
if [[ "-h" == "$1" ]]; then
echo "-"
echo "${wb}${bf}———————————————— Help! ————————————————${r}"
echo "${wb}${bf}————————————————-------————————————————${r}"
echo "${wb}${bf}——— Usage: wpcp ———${r}"
echo "-"
return 1
else
echo "-"
echo "${wb} ${bf}--------------- ⏲ START: Let's create a patch... ---------------${r}"
echo "-"
wpcore
echo "-"
echo "—————————————————————————————"
echo "${wb} ${bf}➤ Ticket # (3456 or 3456.1):${r}"
echo "—————————————————————————————"
read -r WPC_PATCH_NAME
git diff -- . ':(exclude)Gruntfile.js' > $WPC_PATCH_NAME.diff
echo "-"
echo "${gb} ${bf}--------------- ✔︎✔︎✔︎ DONE!!! "$WPC_PATCH_NAME".diff Created! 💯 🎉 ✔✔✔ ---------------${r}"
echo "-"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment