File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
.github/workflows/scripts Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 3939
4040paths_with_missing_license=( )
4141
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+
4247if [[ -f .licenseignore ]]; then
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"
48+ static_exclude_list+=( ' ":(exclude).licenseignore"' )
49+ IFS=$' \n ' read -d ' ' -r -a dynamic_exclude_list <<< " $(sed -E 's/^(.*)$/" :(exclude)\1 " /' <.licenseignore)"
4850fi
4951
50- file_paths=$( echo " $exclude_list " | xargs git ls-files)
52+ exclude_list=( " ${static_exclude_list[@]} " " ${dynamic_exclude_list[@]} " )
53+ excludes=$( IFS=" " ; echo " ${exclude_list[*]} " )
54+
55+ file_paths=$( echo " $excludes " | xargs git ls-files)
5156
5257while IFS= read -r file_path; do
5358 file_basename=$( basename -- " ${file_path} " )
You can’t perform that action at this time.
0 commit comments