Skip to content

Instantly share code, notes, and snippets.

@amiad
Created August 17, 2020 21:15
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 amiad/9a467647f87ab51cfc973a4752953a05 to your computer and use it in GitHub Desktop.
Save amiad/9a467647f87ab51cfc973a4752953a05 to your computer and use it in GitHub Desktop.
Update Wordpress version in readme of all plugins
#!/bin/bash
if [ -z "$1" ]; then
echo "version missed!"
exit 0
fi
plugins="ligery wordpress-hebrew-date en-spam"
plugindir="/home/plugins"
for plugin in $plugins; do
pushd $plugindir/$plugin > /dev/null
last=$(ls tags | tail -1)
dirs="trunk tags/$last"
for dir in $dirs; do
sed -i "s/Tested up to: [0-9.]*/Tested up to: 5.5/" "$dir/readme.txt"
svn add "$dir/readme.txt"
echo "$dir/readme.txt updated!"
if [ -f "$dir/README.md" ]; then
sed -i 's/\*\*Tested up to:\*\* [0-9.]*/\*\*Tested up to:\*\* $1/' "$dir/README.md"
svn add "$dir/README.md"
echo "$dir/README.md updated!"
fi
done
svn ci -m "update to $1"
echo "$plugin updated!!!"
popd > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment