Skip to content

Commit fa6a1b4

Browse files
committed
Fix display bug in set_copyright_year.sh
Previously the script only output the first problem with the copyright issue, which is inefficient. This adapts the script to output all copyright issues. Fixes eclipse-basyx#451
1 parent a081c0c commit fa6a1b4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

etc/scripts/set_copyright_year.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# Run this script with --check to have it raise an error if it
1414
# would change anything.
1515

16+
# Initialise a variable to track if any error occurred
17+
EXIT_CODE=0
1618

1719
# Set CHECK_MODE based on whether --check is passed
1820
CHECK_MODE=false
@@ -33,7 +35,8 @@ while read -rd $'\0' year file; do
3335

3436
if $CHECK_MODE && [[ "$current_year" != "$year" ]]; then
3537
echo "Error: Copyright year mismatch in file $file. Expected $year, found $current_year."
36-
exit 1
38+
# Set ERROR_CODE to 1 to indicate mismatch
39+
ERROR_CODE=1
3740
fi
3841

3942
if ! $CHECK_MODE && [[ "$current_year" != "$year" ]]; then
@@ -42,3 +45,4 @@ while read -rd $'\0' year file; do
4245
fi
4346
done < <(git ls-files -z "$@" | xargs -0I{} git log -1 -z --format="%cd {}" --date="format:%Y" -- "{}")
4447

48+
exit $EXIT_CODE

0 commit comments

Comments
 (0)