How to exit bash function if error? : <p>I am making a presubmit script. It looks like this:</p>

<pre><code>function presubmit() {
  gradle test android
  gradle test ios
  gradle test server
  git push origin master
}
</code></pre>

<p>I want the function to exit, if any of the tests fail so it won't push a bug to git. How?</p>
