mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Scripts/git-pre-commit-hook : Restrict copyright year checks.
This commit is contained in:
parent
e4f207d8a1
commit
51ed3d5eef
@ -20,14 +20,16 @@ user=`git config --global user.email`
|
||||
year=`date +"%Y"`
|
||||
|
||||
missing_copyright_year=""
|
||||
for f in $files ; do
|
||||
if test `head -5 $f | grep -c -i copyright` -gt 0 ; then
|
||||
user_copyright=`grep -i copyright $f | grep $user | grep -c $year`
|
||||
if test $user_copyright -lt 1 ; then
|
||||
missing_copyright_year="$missing_copyright_year $f"
|
||||
if test $user = "erikd@mega-nerd.com" ; then
|
||||
for f in $files ; do
|
||||
if test `head -5 $f | grep -c -i copyright` -gt 0 ; then
|
||||
user_copyright=`grep -i copyright $f | grep $user | grep -c $year`
|
||||
if test $user_copyright -lt 1 ; then
|
||||
missing_copyright_year="$missing_copyright_year $f"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$missing_copyright_year" ; then
|
||||
echo "Missing current year in the copyright notice of the following files:"
|
||||
|
Loading…
Reference in New Issue
Block a user