Skip to content

Commit 0f62cd1

Browse files
authored
Merge pull request #68 from Pangjiping/hotfix/verify-licence
fix year-spanning issue in verify-license script
2 parents e193de5 + b19e4de commit 0f62cd1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/verify-license.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ set -euo pipefail
2121

2222
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
2323
CURRENT_YEAR="$(date +%Y)"
24+
MIN_YEAR="2025"
2425
LICENSE_OWNER="Alibaba Group Holding Ltd."
2526
LICENSE_REGEX="Copyright [0-9]{4} ${LICENSE_OWNER// / }"
2627

@@ -131,7 +132,7 @@ while IFS= read -r file; do
131132
continue
132133
fi
133134
found_year="$(echo "$header" | grep -Eo "$LICENSE_REGEX" | head -n1 | grep -Eo '[0-9]{4}')"
134-
if [[ -z "$found_year" || "$found_year" -lt "$CURRENT_YEAR" ]]; then
135+
if [[ -z "$found_year" || "$found_year" -gt "$CURRENT_YEAR" || "$found_year" -lt "$MIN_YEAR" ]]; then
135136
missing+=("$file")
136137
fi
137138
done < <(git -C "$REPO_ROOT" ls-files)

0 commit comments

Comments
 (0)