Developed on macOS, the bash script you are going to read about is born from the need to automate some of the tasks a plugin developer has to routinely do to publish plugin updates on WordPress.org.
What it Does
In chronological order, the following are all the tasks the script goes through:
- Checks whether or not the 'Stable tag' value in the
readme.txtfile matches the 'Version' value found in the
- Verifies that the current version of the plugin hasn't already been tagged, and so, published.
-minsuffix in the filename.
- Synchronises the 'trunk' folder of the Working Copy with the plugin's folder, by leaving out the
.DS_Storefiles and the
.gitfolder that might be present.
- If needed, runs
svn deleteon the paths of the files respectively added to or deleted from the 'trunk' folder.
- Makes a SVN copy of the 'trunk' folder to the
tags/current_versionsubdirectory of the Working Copy.
- And finally publishes the update on WordPress.org by committing the changes made to the Working Copy of the SVN repository.
The whole execution flows like a brook. The only times the script asks for your input is when a check fails. For example, it might ask you whether or not it should update the 'Stable tag' value for you, or if it must go on with the execution in case 'uglifycss' or 'uglifyjs' are not installed.
Publishing a Plugin Update
Before you can use the script, the
config.json file bundled with it needs to be filled in. Then, you can publish your next plugin update like so:
$ path-to/publish-plugin-update.sh plugin-folder-name
The script can also be launched bare-bones however, the parameter is optional.
If for some reason the script you download from GitHub isn't executable, you can make it so by running the following command:
chmod +x path-to/publish-plugin-update.sh