From eaf8386cedd2fdaa386144a3ddae46e99297ec1f Mon Sep 17 00:00:00 2001 From: katieclaiborne-duet Date: Tue, 27 Aug 2024 05:09:30 -0400 Subject: [PATCH] Add Windows version of each exclusion item to duplicated list (#486) --- macros/set_is_excluded.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/macros/set_is_excluded.sql b/macros/set_is_excluded.sql index f7067da1..411a763a 100644 --- a/macros/set_is_excluded.sql +++ b/macros/set_is_excluded.sql @@ -18,8 +18,16 @@ {% endif %} - {#- we exclude the resource if it is from the current project and matches the pattern -#} + {#- we duplicate the exclusion list to account for windows directory patterns -#} + {%- set exclude_all_os_paths_from_project = [] -%} + {%- for exclude_paths_pattern in var('exclude_paths_from_project',[]) -%} + {%- set windows_path_pattern = exclude_paths_pattern | replace("/", "\\\\\\\\") -%} + {%- do exclude_all_os_paths_from_project.extend([exclude_paths_pattern, windows_path_pattern]) -%} + {%- endfor -%} + + {#- we exclude the resource if it is from the current project and matches the pattern -#} + {%- for exclude_paths_pattern in exclude_all_os_paths_from_project -%} {%- set matched_path = re.search(exclude_paths_pattern, resource_path, re.IGNORECASE) -%} {%- if matched_path and resource.package_name == project_name %} {% set ns.exclude = true %}