erlware/relx — pull request #287 by lukebakken (2014-12-24 21:35:57+00:00)
Title: Explicitly use 'exit 1' to exit

Fixes #286

Using `exit $?` will exit with 0 status even in error conditions. I believe this is due to the fact that the `if` statement sets `$?` somehow. This could be a bug in the version of `bash` I'm using (as `/bin/sh` on Arch Linux):

```
$ /bin/sh --version
GNU bash, version 4.3.30(1)-release (x86_64-unknown-linux-gnu)
```

Output from testing. The first execution is using a release built with `relx` without these changes - you can see the exit code is 0 even though the ping fails. Then I copy the new `relx`, rebuild, and you can see the correct exit status.

```sh
$ /tmp/autodeploy/autodeploy_release/bin/autodeploy_release ping; echo $?
Node 'autodeploy@127.0.0.1' not responding to pings.
0

$ cp ~/Projects/src/relx/relx .

$ make clean debug > /dev/null 2>&1

$ /tmp/autodeploy/autodeploy_release/bin/autodeploy_release ping; echo $?
Node 'autodeploy@127.0.0.1' not responding to pings.
1
```