mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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.
This commit is contained in:
parent
1b6010bedf
commit
3f9fc97de7
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
function realpath_int() {
|
function realpath_int() {
|
||||||
wdir="$PWD"; [ "$PWD" = "/" ] && wdir=""
|
wdir="$PWD"; [ "$PWD" = "/" ] && wdir=""
|
||||||
case "$0" in
|
arg=$1
|
||||||
/*) scriptdir="${0}";;
|
case "$arg" in
|
||||||
*) scriptdir="$wdir/${0#./}";;
|
/*) scriptdir="${arg}";;
|
||||||
|
*) scriptdir="$wdir/${arg#./}";;
|
||||||
esac
|
esac
|
||||||
scriptdir="${scriptdir%/*}"
|
scriptdir="${scriptdir%/*}"
|
||||||
echo "$scriptdir"
|
echo "$scriptdir"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user