Skip to content

Commit e4ddde5

Browse files
committed
createrelease: update copyright year script
The year is taken from the last commit that changed the file now rather than current date. Also covers missed python scripts.
1 parent 0b59984 commit e4ddde5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

createrelease

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# cd ~/cppchecksolutions/cppcheck && python3 tools/get_checkers.py > lib/checkers.cpp
4646
#
4747
# Update copyright year: TODO release script
48-
# git diff $PREV -- */*.cpp */*.h | grep '^diff --git a/' | sed 's|.* b/||' | xargs sed -i "s/Copyright (C) 2007-20[12]./Copyright (C) 2007-$(date +%Y)/"
48+
# git grep -l 'Copyright (C) 2007-20' -- '*.cpp' '*.h' '*.py' | while read f; do y=$(git log -1 --format=%ad --date=format:%Y --invert-grep -i --grep=copyright -- "$f"); sed -i "s/Copyright (C) 2007-20[0-9][0-9]/Copyright (C) 2007-$y/" "$f"; done
4949
# git diff | grep '^diff --git a/'
5050
#
5151
# Make sure "cppcheck --errorlist" works:

0 commit comments

Comments
 (0)