We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fcc07bc commit ab9aa32Copy full SHA for ab9aa32
1 file changed
scripts/ci-copyright.sh
@@ -22,13 +22,14 @@ set -e
22
notice() {
23
local file="$1"
24
local start prefix
25
- start=$(sed -n '/ Copyright/{1q2;2q3}' "$file" || echo $?)
26
- [ -n "$start" ] || return
27
- prefix="$(sed -n 's/ Copyright.*//p;T;q' "$file")"
+ start=$(sed -n '/ Copyright/{=;q}' "$file")
+ [ "${start:-3}" -lt 3 ] || return
+ prefix="$(sed -n "$start"'s/ Copyright.*//p' "$file")"
28
case "$prefix" in
29
'//') prefix='\/\/' ;;
30
esac
31
- sed -n "$start"',+12{/^\('"$prefix"'\|$\)/!d;s/^'"$prefix"'/#/;p}' "$file"
+ sed -n "$start"'s/\(Copyright\) ..../\1/;'\
32
+"$start"',+13{/^\('"$prefix"'\|$\)/!d;s/^'"$prefix"'/#/;p}' "$file"
33
}
34
35
REFERENCE_NOTICE="$(notice $0)"
0 commit comments