Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1663)

Unified Diff: sdk/bin/pub

Issue 15362003: Make it possible to symlink to dartdoc and pub in the SDK. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sdk/bin/dartdoc ('K') | « sdk/bin/dartdoc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 $@
« sdk/bin/dartdoc ('K') | « sdk/bin/dartdoc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698