Index: sdk/bin/pub |
diff --git a/sdk/bin/pub b/sdk/bin/pub |
index 76085ab8b6434cb23c205f9491a0e274ec9c9717..68f934a1164f5b6f5d7bbb4ceb6826935d98536f 100755 |
--- a/sdk/bin/pub |
+++ b/sdk/bin/pub |
@@ -3,9 +3,14 @@ |
# structure. |
# Setting BIN_DIR this way is ugly, but is needed to handle the case where |
-# dart-sdk/bin has been symlinked to. On MacOS, readlink doesn't work |
-# with this case. |
-BIN_DIR="$(cd "${0%/*}" ; pwd -P)" |
+# dart-sdk/bin and/or dart-sdk/bin/pub has been symlinked to. On MacOS, readlink |
+# doesn't work with this case. |
+linked_path=`readlink "$0"` |
+if [ "$linked_path" = "" ]; then |
+ BIN_DIR="$(cd "${0%/*}" ; pwd -P)" |
+else |
+ BIN_DIR="$(cd "${linked_path%/*}" ; pwd -P)" |
dgrove
2013/05/30 19:46:38
ditto - I don't understand what this is trying to
|
+fi |
DART_SDK="$(cd "${BIN_DIR%/*}" ; pwd -P)" |
exec "$BIN_DIR"/dart "$DART_SDK"/bin/snapshots/pub.dart.snapshot $@ |