Last active
July 16, 2023 08:40
-
-
Save romain-grecourt/bc6d63863da0e16c1b96e1ad5b5641ba to your computer and use it in GitHub Desktop.
Update copyright year.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# arg1, file with lines of copyright errors from wercker | |
# e.g. | |
# /pipeline/source/pom.xml: Copyright year is wrong; is 2019, should be 2020 | |
# | |
# NOTES: | |
# - stash any local changes before running this script | |
# - check the result with `git status` | |
# - if needed, revert changes with `git reset --hard` | |
COPYRIGHT_PREFIX="Copyright (c)" | |
COPYRIGHT_SUFFIX="Oracle and/or its affiliates. All rights reserved." | |
COPYRIGHT_YEAR="2020" | |
update_copyright(){ | |
sed s@"^\(.* ${COPYRIGHT_PREFIX} [0-9]\{4\}\)\( \{0,1\},\{0,1\}-\{0,1\} \{0,1\}[0-9]\{4\}\)\{0,1\}\( ${COPYRIGHT_SUFFIX}.*$\)"@"\1, ${COPYRIGHT_YEAR}\3"@g | |
} | |
for i in `cat ${1} | cut -d ':' -f1 | sed s@'/pipeline/source/'@@g` | |
do | |
cat $i | update_copyright > $i.tmp ; mv $i.tmp $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version for 2023 Helidon copyright. :)