From: Ivan Grokhotkov Date: Sun, 28 Jul 2019 08:04:36 +0000 (+0200) Subject: tools: export.sh: fix ESP-IDF path detection on macos X-Git-Tag: v4.0-beta1~29^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f9fc97de71d4666c488b08c04cda6681de289d8;p=esp-idf tools: export.sh: fix ESP-IDF path detection on macos The argument passed to the function is in $1; $0 contains `-bash`. Before this fix, IDF_PATH would be set to $PWD instead of the correct path. --- diff --git a/export.sh b/export.sh index 9f8f98f5aa..0408a76bb3 100644 --- a/export.sh +++ b/export.sh @@ -2,9 +2,10 @@ function realpath_int() { wdir="$PWD"; [ "$PWD" = "/" ] && wdir="" - case "$0" in - /*) scriptdir="${0}";; - *) scriptdir="$wdir/${0#./}";; + arg=$1 + case "$arg" in + /*) scriptdir="${arg}";; + *) scriptdir="$wdir/${arg#./}";; esac scriptdir="${scriptdir%/*}" echo "$scriptdir"