idf_tools.py: when guessing IDF_PATH, set it in the enviroment

This allows the processes launched from idf_tools.py to use the value
of IDF_PATH. One such example is the installation of Python packages,
when requirements.txt uses IDF_PATH to refer to the esp-windows-curses
package.

Closes https://github.com/espressif/esp-idf/issues/4341
This commit is contained in:
Ivan Grokhotkov 2019-11-18 16:17:30 +01:00
parent f27a344fc9
commit 09dd8ca3e9

View file

@ -1339,6 +1339,7 @@ def main(argv):
global_idf_path = args.idf_path global_idf_path = args.idf_path
if not global_idf_path: if not global_idf_path:
global_idf_path = os.path.realpath(os.path.join(os.path.dirname(__file__), "..")) global_idf_path = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
os.environ['IDF_PATH'] = global_idf_path
global global_idf_tools_path global global_idf_tools_path
global_idf_tools_path = os.environ.get('IDF_TOOLS_PATH') or os.path.expanduser(IDF_TOOLS_PATH_DEFAULT) global_idf_tools_path = os.environ.get('IDF_TOOLS_PATH') or os.path.expanduser(IDF_TOOLS_PATH_DEFAULT)