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.
pull/3874/head
Ivan Grokhotkov 2019-07-28 10:04:36 +02:00
rodzic 1b6010bedf
commit 3f9fc97de7
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -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"