From 0bc7f3440a35c318a2309f10627daa4f41029ebf Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sat, 14 Mar 2020 20:06:04 +0100 Subject: [PATCH] lib/tests/modules.sh: Don't depend on $PWD --- lib/tests/modules.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index e81cf016ee9..6258244457a 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -3,7 +3,10 @@ # This script is used to test that the module system is working as expected. # By default it test the version of nixpkgs which is defined in the NIX_PATH. -cd ./modules +# https://stackoverflow.com/a/246128/6605742 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +cd "$DIR"/modules pass=0 fail=0