33 lines
465 B
Bash
Executable File
33 lines
465 B
Bash
Executable File
#!/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
|