From 649fc1f7e62da0e5fbb471cd625d29e6a1bba336 Mon Sep 17 00:00:00 2001
From: Agustin Chiappe Berrini <jnieve@gmail.com>
Date: Tue, 14 Nov 2017 11:35:30 -0500
Subject: [PATCH] Make ./examples/run_examples.sh fail loudly (#588)

* Make ./examples/run_examples.sh loudly fail

If you do:

```
./examples/run_examples.sh
rm src/types.rs
./examples/run_examples.sh
```

The second run will succeed even though the compilation failed. Fix this
by making the script fail if one of the steps fail.

* and set +e before the for
---
 Cargo.toml               | 1 +
 examples/run_examples.sh | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/Cargo.toml b/Cargo.toml
index 31e5675d..2b649604 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -42,6 +42,7 @@ rand = "0.3"
 git = "https://github.com/redox-os/app-dirs-rs.git"
 
 [profile.release]
+debug = true
 lto = true
 panic = "abort"
 
diff --git a/examples/run_examples.sh b/examples/run_examples.sh
index bfea101f..a10e9f17 100755
--- a/examples/run_examples.sh
+++ b/examples/run_examples.sh
@@ -1,5 +1,7 @@
 #!/usr/bin/env bash
 
+set -e -u -o pipefail
+
 RED='\033[0;31m'
 GREEN='\033[0;32m'
 NC='\033[0m' # No Color
@@ -49,6 +51,7 @@ function check_return_value {
 # Build debug binary
 cargo build
 
+set +e
 # Iterate over every Ion script in examples directory
 for i in $EXAMPLES_DIR/*.ion; do
     check_return_value $i;
-- 
GitLab