Skip to content

Commit 2c88ee5

Browse files
add license checking for snippets that uses tail
1 parent 1d761ea commit 2c88ee5

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

bin/check-source

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ printf "\033[0;32mokay.\033[0m\n"
4040
printf "=> Checking license headers… "
4141
tmp=$(mktemp /tmp/.swift-markdown-check-source_XXXXXX)
4242

43-
for language in swift-or-c bash md-or-tutorial html docker; do
43+
for language in swift-or-c snippet bash md-or-tutorial html docker; do
4444
declare -a matching_files
4545
declare -a exceptions
4646
declare -a reader
@@ -61,6 +61,22 @@ for language in swift-or-c bash md-or-tutorial html docker; do
6161
See https://swift.org/LICENSE.txt for license information
6262
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
6363
*/
64+
EOF
65+
;;
66+
snippet)
67+
matching_files=( -name '*.swift' -a -path './Snippets/*')
68+
exceptions=( -name 'Package*.swift')
69+
reader=tail
70+
cat > "$tmp" <<"EOF"
71+
/*
72+
This source file is part of the Swift.org open source project
73+
74+
Copyright (c) YEARS Apple Inc. and the Swift project authors
75+
Licensed under Apache License v2.0 with Runtime Library Exception
76+
77+
See https://swift.org/LICENSE.txt for license information
78+
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
79+
*/
6480
EOF
6581
;;
6682
bash)
@@ -150,3 +166,4 @@ done
150166
printf "\033[0;32mokay.\033[0m\n"
151167
rm "$tmp"
152168

169+
# vim: filetype=bash shiftwidth=2 softtabstop=2

0 commit comments

Comments
 (0)