Index: sdk/bin/dart |
diff --git a/sdk/bin/dart b/sdk/bin/dart |
index 22abed8b5e623c3425c39b9798a3754f58c309c8..eab8603b7de39a0160a920531edd18a4390020dd 100755 |
--- a/sdk/bin/dart |
+++ b/sdk/bin/dart |
@@ -4,8 +4,10 @@ |
# BSD-style license that can be found in the LICENSE file. |
# Setting CUR_DIR this way is ugly, but is needed to handle the case where |
-# sdk/bin has been symlinked to. On MacOS, readlink doesn't work with this case. |
-CUR_DIR="$(cd "${0%/*}" ; pwd -P)" |
+# sdk/bin or the script itself has been symlinked to. On MacOS, readlink -f |
+# doesn't work with this case. |
+SCRIPT=`readlink "$0" || echo "$0"` |
+CUR_DIR="$(cd "${SCRIPT%/*}" ; pwd -P)" |
if [ -z "$DART_CONFIGURATION" ]; |
then |