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

Unified Diff: utils/compiler/build_helper.dart

Issue 10985068: Fix issue 3402 . The initial suggestion of using readlink doesn't (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/compiler/build_helper.dart
===================================================================
--- utils/compiler/build_helper.dart (revision 12972)
+++ utils/compiler/build_helper.dart (working copy)
@@ -98,12 +98,19 @@
return [
'''
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
-BIN_DIR=`dirname \$0`
+# The following line MUST be the first command in the script.
+ABS_SCRIPT_PATH="\$_"
+
+# 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 "\${ABS_SCRIPT_PATH%/*}" ; pwd -P)"
+
unset COLORS
if test -t 1; then
# Stdout is a terminal.
@@ -112,7 +119,7 @@
COLORS="--enable-diagnostic-colors"
fi
fi
-exec \$BIN_DIR/dart$options \$BIN_DIR/$path \$COLORS "\$@"
+exec "\$BIN_DIR"/dart$options "\$BIN_DIR/$path" \$COLORS "\$@"
''',
'''
@echo off
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698