Skip to content

Commit

Permalink
build: Support gateway-docker, quit on error
Browse files Browse the repository at this point in the history
To avoid unexpected behaviours, quit on error (set -e)

Change-Id: Ifbf6401b66afd71472f1b953a7aa4b57c0ecfd3f
Relate-to: WebThingsIO/gateway-docker#9
Signed-off-by: Philippe Coval <[email protected]>
  • Loading branch information
rzr committed Aug 10, 2018
1 parent f7333ac commit 56a6686
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions run-app.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -e
set -x

MOZIOT_HOME="${MOZIOT_HOME:=${HOME}/.mozilla-iot}"
args=""

is_docker_container() {
if [ -f /.dockerenv ]; then
Expand All @@ -13,8 +16,8 @@ is_docker_container() {

return 1
}

if ! is_docker_container; then
args="$args --check-wifi"
if [ ! -f .post_upgrade_complete ]; then
./tools/post-upgrade.sh
fi
Expand All @@ -27,13 +30,13 @@ run_app() {
sudo /sbin/ldconfig

echo "nvm version"
nvm --version
nvm --version || echo "Use system's node insead of nvm"
echo "node version"
node --version
echo "npm version"
npm --version
echo "Starting gateway ..."
npm start -- --check-wifi
npm start -- $args
}

mkdir -p "${MOZIOT_HOME}/log"
Expand Down

0 comments on commit 56a6686

Please sign in to comment.