Commit a24e9030 authored by Alfred Morgan's avatar Alfred Morgan Committed by Adam Barth

fixed #4179 bin/flutter fails when linked with relative symlink (#4196)

* fixed issue #4179 bin/flutter fails when linked with relative symlink

* fixed issue #4179 bin/flutter fails when linked with relative symlink

* My second attempt at following symlinks correctly
parent c69cff94
......@@ -6,12 +6,16 @@
set -e
function follow_links() {
file="$1"
cd -P "${1%/*}"
file="$PWD/${1##*/}"
while [ -h "$file" ]; do
# On Mac OS, readlink -f doesn't work.
cd -P "${file%/*}"
file="$(readlink "$file")"
cd -P "${file%/*}"
file="$PWD/${file##*/}"
done
echo "$file"
echo "$PWD/${file##*/}"
}
PROG_NAME="$(follow_links "$BASH_SOURCE")"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment