tools/idf.py: prevent reloading duplicate extension paths. Do not load cwd if IDF_EXTRA_ACTIONS_PATH is not set.
Merges https://github.com/espressif/esp-idf/pull/5278
This commit is contained in:
parent
f9a5794cba
commit
fa3d9573ce
11
tools/idf.py
11
tools/idf.py
|
@ -635,10 +635,15 @@ def init_cli(verbose_output=None):
|
||||||
all_actions = {}
|
all_actions = {}
|
||||||
# Load extensions from components dir
|
# Load extensions from components dir
|
||||||
idf_py_extensions_path = os.path.join(os.environ["IDF_PATH"], "tools", "idf_py_actions")
|
idf_py_extensions_path = os.path.join(os.environ["IDF_PATH"], "tools", "idf_py_actions")
|
||||||
extra_paths = os.environ.get("IDF_EXTRA_ACTIONS_PATH", "").split(';')
|
extension_dirs = [realpath(idf_py_extensions_path)]
|
||||||
extension_dirs = [idf_py_extensions_path] + extra_paths
|
extra_paths = os.environ.get("IDF_EXTRA_ACTIONS_PATH")
|
||||||
extensions = {}
|
if extra_paths is not None:
|
||||||
|
for path in extra_paths.split(';'):
|
||||||
|
path = realpath(path)
|
||||||
|
if path not in extension_dirs:
|
||||||
|
extension_dirs.append(path)
|
||||||
|
|
||||||
|
extensions = {}
|
||||||
for directory in extension_dirs:
|
for directory in extension_dirs:
|
||||||
if directory and not os.path.exists(directory):
|
if directory and not os.path.exists(directory):
|
||||||
print('WARNING: Directroy with idf.py extensions doesn\'t exist:\n %s' % directory)
|
print('WARNING: Directroy with idf.py extensions doesn\'t exist:\n %s' % directory)
|
||||||
|
|
Loading…
Reference in a new issue