From c11012dcbf98dcb045b8516e0f42197eff7a9465 Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Fri, 5 Jun 2015 15:08:52 +0200 Subject: [PATCH] Fix DIR issues --- scripts/lib/common.sh | 2 +- scripts/start-sandbox.sh | 3 ++- scripts/test-all.sh | 5 ++++- scripts/update-defaults-nix.sh | 3 ++- scripts/upload.sh | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/lib/common.sh b/scripts/lib/common.sh index d41a8988..19b85d5d 100644 --- a/scripts/lib/common.sh +++ b/scripts/lib/common.sh @@ -10,7 +10,7 @@ #=============================================================================== -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )) DRY_RUN=false POSITION="none" SOURCES_TXT="$( dirname $DIR)/sources.txt" diff --git a/scripts/start-sandbox.sh b/scripts/start-sandbox.sh index 1c1cab5a..b6e88759 100755 --- a/scripts/start-sandbox.sh +++ b/scripts/start-sandbox.sh @@ -13,7 +13,8 @@ set -o nounset set -o errexit -. lib/common.sh +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +. "$DIR"/lib/common.sh prepare_sandbox () { $CABAL sandbox init diff --git a/scripts/test-all.sh b/scripts/test-all.sh index 111e4e9d..5c78312c 100755 --- a/scripts/test-all.sh +++ b/scripts/test-all.sh @@ -14,7 +14,10 @@ set -o nounset set -o errexit -. lib/common.sh +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +. "$DIR"/lib/common.sh + +GHC_FLAGS="-Werror" prepare_sandbox () { $CABAL sandbox init diff --git a/scripts/update-defaults-nix.sh b/scripts/update-defaults-nix.sh index 4ad7a291..fb70bb82 100755 --- a/scripts/update-defaults-nix.sh +++ b/scripts/update-defaults-nix.sh @@ -11,7 +11,8 @@ set -o nounset set -o errexit -. lib/common.sh +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +. "$DIR"/lib/common.sh for s in ${SOURCES[@]} ; do echo $s diff --git a/scripts/upload.sh b/scripts/upload.sh index fc0219f7..f9898b92 100755 --- a/scripts/upload.sh +++ b/scripts/upload.sh @@ -15,7 +15,8 @@ set -o nounset set -o errexit -. lib/common.sh +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +. "$DIR"/lib/common.sh usage () { echo " upload.sh "