From 3601291b94c245c4def3987612d4d9b29fe04617 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Wed, 1 Aug 2018 21:30:52 -0500 Subject: [PATCH] move override-ables to the top --- run.sh | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/run.sh b/run.sh index fabe833..837b51e 100755 --- a/run.sh +++ b/run.sh @@ -1,16 +1,13 @@ #!/usr/bin/env bash run_embark () { - local oldopts="" - case $- in - *e*) oldopts="set -e" ;; - *) oldopts="set +e" ;; - esac - if [[ $(shopt -po history) = "set -o history" ]]; then - oldopts="$oldopts; set -o history" - fi - set +e - set +o history + local EMBARK_DOCKER_EXTRA_RUN_OPTS=${EMBARK_DOCKER_EXTRA_RUN_OPTS:-"-e __embark_docker_runsh"} + local EMBARK_DOCKER_MOUNT_SOURCE=${EMBARK_DOCKER_MOUNT_DIR:-$PWD} + local EMBARK_DOCKER_MOUNT_TARGET=${EMBARK_DOCKER_MOUNT_DIR:-/dapp} + local EMBARK_DOCKER_IMAGE=${EMBARK_DOCKER_IMAGE:-statusim/embark} + local EMBARK_DOCKER_RUN=${EMBARK_DOCKER_RUN} + local EMBARK_DOCKER_RUN_INTERACTIVE=${EMBARK_DOCKER_RUN_INTERACTIVE:-false} + local EMBARK_DOCKER_TAG=${EMBARK_DOCKER_TAG:-latest} local txtbld=$(tput bold) local txtrst=$(tput sgr0) @@ -23,6 +20,17 @@ run_embark () { local INFO=${bldcyn}INFO${txtrst} local WARNING=${bldylw}WARNING${txtrst} + local oldopts="" + case $- in + *e*) oldopts="set -e" ;; + *) oldopts="set +e" ;; + esac + if [[ $(shopt -po history) = "set -o history" ]]; then + oldopts="$oldopts; set -o history" + fi + set +e + set +o history + check_bash_version () { if [[ $BASH_VERSINFO -lt 4 ]]; then echo "$ERROR: this script requires Bash version >= 4.0" @@ -62,13 +70,7 @@ run_embark () { fi fi - local dummy="-e __embark_docker_runsh" - local EMBARK_DOCKER_EXTRA_RUN_OPTS=${EMBARK_DOCKER_EXTRA_RUN_OPTS:-$dummy} local -a extra_run_opts=( $EMBARK_DOCKER_EXTRA_RUN_OPTS ) - local EMBARK_DOCKER_MOUNT_SOURCE=${EMBARK_DOCKER_MOUNT_DIR:-$PWD} - local EMBARK_DOCKER_MOUNT_TARGET=${EMBARK_DOCKER_MOUNT_DIR:-/dapp} - local EMBARK_DOCKER_IMAGE=${EMBARK_DOCKER_IMAGE:-statusim/embark} - local EMBARK_DOCKER_TAG=${EMBARK_DOCKER_TAG:-latest} local -a cmd=( "$@" ) case $1 in