From ace27819fe62e16e4de26521641992d7f24b71f7 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Mon, 14 May 2018 17:11:38 -0700 Subject: [PATCH] Fix flutter shell script to handle properly shells that have CDPATH set (#17589) Before this change, if CDPATH was set, and you type (from the flutter root) "bin/flutter --version" you would get an error. This is because the cd command in follow_links was printing the directory Bash chose from the CDPATH to stdout, causing the path to have a newline in it, which understandably confuses the rest of the script. --- bin/flutter | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/flutter b/bin/flutter index 079c3f94d0..0aef55e543 100755 --- a/bin/flutter +++ b/bin/flutter @@ -14,6 +14,8 @@ set -e +unset CDPATH + function follow_links() { cd -P "${1%/*}" local file="$PWD/${1##*/}"