Skip to content

Commit

Permalink
Add Windows version of each exclusion item to duplicated list (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
katieclaiborne-duet authored Aug 27, 2024
1 parent fb96c46 commit eaf8386
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion macros/set_is_excluded.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit eaf8386

Please sign in to comment.