refactor: Simplify enabling debug

Simplify the logic to enable debug and also enable debug as early as
possible.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2018-04-19 15:55:34 +01:00
parent 2b2b68d6fa
commit f3e89d38a9
3 changed files with 6 additions and 12 deletions

View File

@ -6,13 +6,11 @@
set -e
[ -n "$DEBUG" ] && set -x
script_name="${0##*/}"
script_dir="$(dirname $(readlink -f $0))"
if [ -n "$DEBUG" ] ; then
set -x
fi
SCRIPT_NAME="${0##*/}"
IMAGE="${IMAGE:-kata-containers.img}"
AGENT_BIN=${AGENT_BIN:-kata-agent}

View File

@ -6,13 +6,11 @@
set -e
[ -n "$DEBUG" ] && set -x
script_name="${0##*/}"
script_dir="$(dirname $(readlink -f $0))"
if [ -n "$DEBUG" ] ; then
set -x
fi
SCRIPT_NAME="${0##*/}"
INITRD_IMAGE="${INITRD_IMAGE:-kata-containers-initrd.img}"
AGENT_BIN=${AGENT_BIN:-kata-agent}

View File

@ -6,6 +6,8 @@
set -e
[ -n "$DEBUG" ] && set -x
script_name="${0##*/}"
script_dir="$(dirname $(readlink -f $0))"
AGENT_VERSION=${AGENT_VERSION:-master}
@ -26,10 +28,6 @@ typeset -r CONFIG_SH="config.sh"
# Name of the extra file that could implement build_rootfs
typeset -r LIB_SH="rootfs_lib.sh"
if [ -n "$DEBUG" ] ; then
set -x
fi
#$1: Error code if want to exit differnt to 0
usage(){
error="${1:-0}"