Running bash script to build a plugin before building Unity project

I have a bash script to build an Android plugin that is used by a Unity project. I want to get Unity to run the script when I click on “Build and Run” to build and run the Android Unity project. How can I do this?

The build process can be invoked from script, see:

Copy the example from that page, and before the call to BuildPlayer get your script executed, I guess with Process.Start().