From f5c60ee47c097d7408470e4be6182bf9ee684e84 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Mon, 30 Oct 2017 16:18:59 +0100 Subject: build: Improve bash scripts This improves the bash scripts so they are less error prone. Mistakes were found using the parser on shellcheck.net Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- compile_debug.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compile_debug.sh') diff --git a/compile_debug.sh b/compile_debug.sh index 3ecab3c0..3ea31882 100755 --- a/compile_debug.sh +++ b/compile_debug.sh @@ -4,7 +4,7 @@ ME=compile_debug if (($# == 1 )) then - PREFIX=`echo "$1"|sed -e "s,\/$,,"` + PREFIX=${1/%\//} else PREFIX="/usr/local/ouroboros" fi @@ -20,7 +20,7 @@ if test -n "$BUILDDIR" ; then echo "$ME: Cannot create directory '$BUILDDIR'" } fi -cd $BUILDDIR +cd $BUILDDIR || exit 1 echo "$ME: Debug directory will be '$DEBUGDIR'" if test -n "$DEBUGDIR" ; then @@ -28,7 +28,7 @@ if test -n "$DEBUGDIR" ; then echo "$ME: Cannot create directory '$DEBUGDIR'" } fi -cd $DEBUGDIR +cd $DEBUGDIR || exit 1 cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Debug ../.. -- cgit v1.2.3