esp-adf icon indicating copy to clipboard operation
esp-adf copied to clipboard

Cannot source `export.sh` from another working directory (AUD-6560)

Open Rodrigodd opened this issue 5 months ago • 1 comments

Is your feature request related to a problem? Please describe.

I am creating aliases for sourcing export.sh for each esp-idf and esp-adf versions. But sourcing esp-adf/export.sh only work when the terminal is inside esp-adf/.

From the code it uses dirname $0 to get the script path, but $0 only have the script path when executing it directly, when sourcing the $0 is just bash.

Describe the solution you'd like

It should copy the solution from esp-idf/export.sh. There it uses BASH_SOURCE env var, but I am not familiar with it.

Describe alternatives you've considered

I can make my alias do cd ~/esp/esp-adf/; . export.sh; cd -, but that pollutes $OLDPWD.

Additional context

Rodrigodd avatar Jul 18 '25 14:07 Rodrigodd

Please check https://github.com/espressif/esp-adf/issues/1503

LiuCodee avatar Jul 30 '25 06:07 LiuCodee