From 2560a50a7b54090136f3bef1d884a95356ef8474 Mon Sep 17 00:00:00 2001 From: David Chalco <59750547+dachalco@users.noreply.github.com> Date: Fri, 16 Apr 2021 18:11:38 -0700 Subject: prune .git from versioning search (#561) Co-authored-by: Archit Aggarwal --- .github/scripts/versioning.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/versioning.py b/.github/scripts/versioning.py index b4607cc2e..55a2715bc 100755 --- a/.github/scripts/versioning.py +++ b/.github/scripts/versioning.py @@ -69,7 +69,7 @@ def ask_yes_no_question(question): return answer -def list_files_in_a_component(component, afr_path, exclude_dirs=[], ext_filter=['.c', '.h'], exclude_hidden=True): +def list_files_in_a_component(component, afr_path, exclude_dirs=['.git'], ext_filter=['.c', '.h'], exclude_hidden=True): ''' Returns a list of all the files in a component. ''' @@ -81,6 +81,9 @@ def list_files_in_a_component(component, afr_path, exclude_dirs=[], ext_filter=[ if root in exclude_dirs: continue + # Prune excluded dirs + dirs[:] = [d for d in dirs if d not in exclude_dirs] + for f in files: if exclude_hidden and f[0] == '.': continue -- cgit v1.2.1