From dfc68bdab9973b0d5ed4e285270d4282604988b2 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 8 Nov 2021 18:55:01 +0100 Subject: [PATCH] tools: Create the ".espressif" directory on the first run on clean system Closes https://github.com/espressif/esp-idf/issues/7848 --- tools/idf_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/idf_tools.py b/tools/idf_tools.py index 2b450f4556..5b57c567bd 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -1054,6 +1054,9 @@ def export_targets_to_idf_env_json(targets): # type: (list[str]) -> None break try: + if global_idf_tools_path: # mypy fix for Optional[str] in the next call + # the directory doesn't exist if this is run on a clean system the first time + mkdir_p(global_idf_tools_path) with open(os.path.join(global_idf_tools_path, IDF_ENV_FILE), 'w') as w: # type: ignore json.dump(idf_env_json, w, indent=4) except (IOError, OSError):