mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Set FLUTTER_ROOT to an absolute path
This implementation was taken from the Dart SDK shell scripts. BUG=https://github.com/flutter/flutter/issues/2795
This commit is contained in:
parent
da88f1d01f
commit
e10b74cd24
14
bin/flutter
14
bin/flutter
@ -5,7 +5,19 @@
|
||||
|
||||
set -e
|
||||
|
||||
export FLUTTER_ROOT=$(dirname $(dirname "${BASH_SOURCE[0]}"))
|
||||
function follow_links() {
|
||||
file="$1"
|
||||
while [ -h "$file" ]; do
|
||||
# On Mac OS, readlink -f doesn't work.
|
||||
file="$(readlink "$file")"
|
||||
done
|
||||
echo "$file"
|
||||
}
|
||||
|
||||
PROG_NAME="$(follow_links "$BASH_SOURCE")"
|
||||
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
||||
export FLUTTER_ROOT="$(cd "${BIN_DIR}/.." ; pwd -P)"
|
||||
|
||||
FLUTTER_TOOLS_DIR="$FLUTTER_ROOT/packages/flutter_tools"
|
||||
SNAPSHOT_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.snapshot"
|
||||
STAMP_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.stamp"
|
||||
|
Loading…
Reference in New Issue
Block a user