Skip to content

Commit 7efbd2d

Browse files
authored
Merge pull request #50 from swiftlang/fb-license-check-cleanuo
Clean up license check script
2 parents 43aff0e + b8fd0d8 commit 7efbd2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/scripts/check-license-header.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ fi
4141
paths_with_missing_license=( )
4242

4343
if [[ -f .licenseignore ]]; then
44-
file_paths=$(tr '\n' '\0' < .licenseignore | xargs -0 -I% printf '":(exclude)%" '| xargs git ls-files ":(exclude).licenseignore" ":(exclude).license_header_template" )
44+
static_exclude_list='":(exclude).licenseignore" ":(exclude).license_header_template" '
45+
dynamic_exclude_list=$(tr '\n' '\0' < .licenseignore | xargs -0 -I% printf '":(exclude)%" ')
46+
exclude_list=$static_exclude_list$dynamic_exclude_list
4547
else
46-
file_paths=$(git ls-files ":(exclude).license_header_template" )
48+
exclude_list=":(exclude).license_header_template"
4749
fi
4850

51+
file_paths=$(echo "$exclude_list" | xargs git ls-files)
4952

5053
while IFS= read -r file_path; do
5154
file_basename=$(basename -- "${file_path}")

0 commit comments

Comments
 (0)