Skip to contentSkip to conversation

Return error if docker install script fails

PATCH New Guilherme Campos Camargo 1 participant 1 message Mar 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Return error if docker install script fails

Before this patch, install.sh would return 0 even if fuego-host-scripts/docker-build-image.sh (that's sourced in it) failed, what could possibly mislead a script or program that depends on its return.

By using 'set -e' we make sure that any failure inside its sourced scripts is propagated, aborting the execution and returning the proper error code.

---
 install.sh | 4 ++++
 1 file changed, 4 insertions(+)
install.sh +4 -0
index 2193559..6441ff0 100755
@@ -1,2 +1,6 @@
+#!/bin/bash
+
+set -e
+
 source fuego-host-scripts/docker-build-image.sh $1
 sudo /bin/sh -c "if [ -f /etc/ttc.conf -a ! -f fuego-ro/conf/ttc.conf ] ; then cp /etc/ttc.conf fuego-ro/conf/ttc.conf ; fi"
Signature · 1 line
2.16.2