-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate-copyright.sh
48 lines (46 loc) · 1.06 KB
/
update-copyright.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
# @file update-copyright.sh
#
# Updates the copyright notices, like
#
# Copyright (C) 2021-2023 Andreas Ekstedt
# Copyright (C) 2021-2023 Philipp Schicho
# Copyright (C) 2021-2023 Tuomas V.I. Tenkanen
#
# in all files in the current directory and its subdirectories.
#
# NOTE: GNU grep/sed required.
#
# Usage:
# update-copyright.sh
#
set -eu
year=$(date +%Y)
grep -l -r 'Copyright *(C).*Ekstedt' . | while IFS= read -r f; do
case $f in
*update-copyright.sh)
;;
*)
sed -i "s/Copyright *(C).*Ekstedt/Copyright (C) 2021-$year Andreas Ekstedt/g" "$f"
;;
esac
done
grep -l -r 'Copyright *(C).*Schicho' . | while IFS= read -r f; do
case $f in
*update-copyright.sh)
;;
*)
sed -i "s/Copyright *(C).*Schicho/Copyright (C) 2021-$year Philipp Schicho/g" "$f"
;;
esac
done
grep -l -r 'Copyright *(C).*Tenkanen' . | while IFS= read -r f; do
case $f in
*update-copyright.sh)
;;
*)
sed -i "s/Copyright *(C).*Tenkanen/Copyright (C) 2021-$year Tuomas V.I. Tenkanen/g" "$f"
;;
esac
done