Skip to content

Commit

Permalink
tools/idf.py: prevent reloading duplicate extension paths. Do not loa…
Browse files Browse the repository at this point in the history
…d cwd if IDF_EXTRA_ACTIONS_PATH is not set.
  • Loading branch information
BrianPugh committed May 13, 2020
1 parent a226357 commit 34a9238
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/idf.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,15 @@ def parse_project_dir(project_dir):
all_actions = {}
# Load extensions from components dir
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 = [idf_py_extensions_path] + extra_paths
extensions = {}
extension_dirs = [realpath(idf_py_extensions_path)]
extra_paths = os.environ.get("IDF_EXTRA_ACTIONS_PATH")
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:
if directory and not os.path.exists(directory):
print('WARNING: Directroy with idf.py extensions doesn\'t exist:\n %s' % directory)
Expand Down

0 comments on commit 34a9238

Please sign in to comment.