Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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