File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
.github/workflows/scripts Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 39
39
40
40
paths_with_missing_license=( )
41
41
42
- static_exclude_list=( )
43
- static_exclude_list+=( ' ":(exclude).license_header_template"' )
44
- static_exclude_list+=( ' ":(exclude).swift-version"' ) # Swift version files do not have comments nor licenses in them
45
- dynamic_exclude_list=( )
46
-
47
42
if [[ -f .licenseignore ]]; then
48
- static_exclude_list+=( ' ":(exclude).licenseignore"' )
49
- IFS=$' \n ' read -d ' ' -r -a dynamic_exclude_list <<< $( sed -E ' s/^(.*)$/":(exclude)\1"/' < .licenseignore)
43
+ static_exclude_list=' ":(exclude).licenseignore" ":(exclude).license_header_template" '
44
+ dynamic_exclude_list=$( tr ' \n' ' \0' < .licenseignore | xargs -0 -I% printf ' ":(exclude)%" ' )
45
+ exclude_list=$static_exclude_list$dynamic_exclude_list
46
+ else
47
+ exclude_list=" :(exclude).license_header_template"
50
48
fi
51
49
52
- exclude_list=( " ${static_exclude_list[@]} " " ${dynamic_exclude_list[@]} " )
53
- excludes=$( IFS=" " ; echo " ${exclude_list[*]} " )
50
+ exclude_list=" ${exclude_list} :(exclude).swift-version" # Swift version files will never have license headers in them
54
51
55
- file_paths=$( echo " $excludes " | xargs git ls-files)
52
+ file_paths=$( echo " $exclude_list " | xargs git ls-files)
56
53
57
54
while IFS= read -r file_path; do
58
55
file_basename=$( basename -- " ${file_path} " )
You can’t perform that action at this time.
0 commit comments