|
1 | 1 | #!/bin/bash |
2 | | -# ===----------------------------------------------------------------------===// |
3 | | -# |
4 | | -# This source file is part of the Swift.org open source project |
5 | | -# |
6 | | -# Copyright (c) 2024 Apple Inc. and the Swift project authors |
7 | | -# Licensed under Apache License v2.0 with Runtime Library Exception |
8 | | -# |
9 | | -# See https://swift.org/LICENSE.txt for license information |
10 | | -# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
11 | | -# |
12 | | -# ===----------------------------------------------------------------------===// |
| 2 | +## ===----------------------------------------------------------------------===## |
| 3 | +## |
| 4 | +## This source file is part of the Swift.org open source project |
| 5 | +## |
| 6 | +## Copyright (c) 2024 Apple Inc. and the Swift project authors |
| 7 | +## Licensed under Apache License v2.0 with Runtime Library Exception |
| 8 | +## |
| 9 | +## See https://swift.org/LICENSE.txt for license information |
| 10 | +## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 11 | +## |
| 12 | +## ===----------------------------------------------------------------------===## |
13 | 13 |
|
14 | 14 | set -euo pipefail |
15 | 15 |
|
|
40 | 40 |
|
41 | 41 | paths_with_missing_license=( ) |
42 | 42 |
|
43 | | -file_excludes=".license_header_template |
44 | | -.licenseignore" |
45 | | -if [ -f .licenseignore ]; then |
46 | | - file_excludes=$file_excludes$(printf '\n')$(cat .licenseignore) |
| 43 | +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" ) |
| 45 | +else |
| 46 | + file_paths=$(git ls-files ":(exclude).license_header_template" ) |
47 | 47 | fi |
48 | | -file_paths=$(echo "$file_excludes" | tr '\n' '\0' | xargs -0 -I% printf '":(exclude)%" '| xargs git ls-files) |
| 48 | + |
49 | 49 |
|
50 | 50 | while IFS= read -r file_path; do |
51 | 51 | file_basename=$(basename -- "${file_path}") |
|
0 commit comments