Skip to content

Instantly share code, notes, and snippets.

@primozcigler
Last active February 3, 2017 17:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save primozcigler/e816919feea345ca393dc4ae90a872fd to your computer and use it in GitHub Desktop.
Show all theme releases from the last month. The script should be placed in wp-content/themes/ and your themes should have .git/ in root.
#!/bin/bash
#
# Gist: https://gist.github.com/primozcigler/e816919feea345ca393dc4ae90a872fd
# How to use it: https://primoz.blog/simple-bash-script-can-tell-releases-given-date-period/
if [[ $# -ne 2 ]]; then
echo "usage: $0 <start date> <end date>"
echo "<date> in format 'YYYY-MM-DD'"
exit
fi
for theme_path in $(find . -maxdepth 1 -mindepth 1 -type d); do
cd $theme_path
if [[ -d .git ]]; then
git pull -q
releases=$(git log --tags --after="$1" --before="$2" --simplify-by-decoration --pretty="format:%ci %d")
if [[ $releases ]]; then
echo "Releases for ${theme_path}:"
echo "${releases}"
echo
fi
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment