mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:57:43 +00:00
d0e8a0b8a6
I am not even sure why we need to pass in this argument, but the tool requires this or it will exit with "Usage: dartanalyzer: no Dart SDK found." This is a fix so that we can get a release out, I will leave it to the analyzer people to figure out if this is needed after all. R=kasperl@google.com Review URL: https://codereview.chromium.org//273863002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35889 260f80e4-7a28-3924-810f-c04153c831b5
32 lines
945 B
Bash
Executable file
32 lines
945 B
Bash
Executable file
#!/bin/bash
|
|
# Copyright (c) 2013, 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.
|
|
|
|
# Run dartanalyzer.dart on the Dart VM. This script assumes the Dart SDK's
|
|
# directory structure.
|
|
|
|
function follow_links() {
|
|
file="$1"
|
|
while [ -h "$file" ]; do
|
|
# On Mac OS, readlink -f doesn't work.
|
|
file="$(readlink "$file")"
|
|
done
|
|
echo "$file"
|
|
}
|
|
|
|
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
|
|
PROG_NAME="$(follow_links "$BASH_SOURCE")"
|
|
|
|
# Handle the case where dart-sdk/bin has been symlinked to.
|
|
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
|
SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
|
|
|
|
SDK_ARG="--dart-sdk=$SDK_DIR"
|
|
|
|
SNAPSHOT="$BIN_DIR/snapshots/dartanalyzer.dart.snapshot"
|
|
|
|
# We are running the snapshot in the built SDK.
|
|
DART="$BIN_DIR/dart"
|
|
exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"
|