I would like to use a run scripts target to tag my revision in mercurial and upload it to a server. I created a new run scripts target that depends on the other target building my app, then I added two run script phases directly one after another.
Now my question: how can I prevent executing run script phase #2 if run script phase #1 gives an error (return code of script is unequal 0)?
The second script would upload the files to a server, so I only want to execute this phase if everything went right until then.
Your first script can abort the build with "exit 1", like this:
if [ error ] then
echo "There are some errors, etc..."
exit 1
fi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With