Skip to content

Instantly share code, notes, and snippets.

@uglyrobot
Created September 11, 2015 14:44
Show Gist options
  • Save uglyrobot/3a6bc020377e680b522e to your computer and use it in GitHub Desktop.
Save uglyrobot/3a6bc020377e680b522e to your computer and use it in GitHub Desktop.
#!/bin/bash
FILENAME=`find . -type f -name "*.pot"`
if [[ -z "$FILENAME" ]] ; then
TEXTDOMAIN=`grep -m 1 --include=*.php "^Textdomain" * | awk -F' ' '{print $2}' | sed 's/[[:space:]]//g'`
if [[ -z "$TEXTDOMAIN" ]] ; then
echo "Please enter the textdomain:"
read TEXTDOMAIN
fi
FILENAME=~/Desktop/$TEXTDOMAIN-default.pot
fi
php ~/Documents/i18n-tools/makepot.php wp-plugin . $FILENAME
echo "Packaged as $FILENAME."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment