From 5987e6932c97f8c18e947bfcf7b41312ebe2bbe7 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 6 Apr 2012 12:25:36 +0200 Subject: [PATCH] MDL-32323 more magic to allow init.sh symlinks from http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in --- admin/tool/phpunit/cli/init.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/tool/phpunit/cli/init.sh b/admin/tool/phpunit/cli/init.sh index 45568c9c06b..fc344f713e0 100755 --- a/admin/tool/phpunit/cli/init.sh +++ b/admin/tool/phpunit/cli/init.sh @@ -1,6 +1,9 @@ #!/bin/bash -CLIDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +CLIDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + UTIL="$CLIDIR/util.php" echo "Initialising test database and creating phpunit.xml configuration..."