pre bulk changes
This commit is contained in:
32
tools/add-copyright-header
Executable file
32
tools/add-copyright-header
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
HEADER=$(cat <<EOF
|
||||
/* Copyright (C) vx-clutch
|
||||
*
|
||||
* This file is part of yait
|
||||
*
|
||||
* This project and file is licenced under the BSD-3-Clause licence.
|
||||
* <https://opensource.org/licence/bsd-3-clause>
|
||||
*/
|
||||
EOF
|
||||
)
|
||||
|
||||
len=${#}
|
||||
|
||||
i=0
|
||||
for file in "$@"
|
||||
do
|
||||
|
||||
i=$((i + 1))
|
||||
printf 'Adding header [%d/%d] %s\n' $i $len $file
|
||||
|
||||
if grep -qF "$HEADER" "$file"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
tmp=$(mktemp)
|
||||
printf '%s\n\n' "$HEADER" > "$tmp"
|
||||
cat $file >> "$tmp"
|
||||
mv "$tmp" $file
|
||||
|
||||
done
|
||||
4
tools/check-copyright-headers
Normal file
4
tools/check-copyright-headers
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
find . -name "*.c" -exec add-copyright-header {} \;
|
||||
find . -name "*.h" -exec add-copyright-header {} \;
|
||||
Reference in New Issue
Block a user