Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion hack/update-copyright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@

ROOT_DIR='./'

for i in `grep -rlZ "Copyright [0-9]\{4\} The PipeCD Authors" $ROOT_DIR`; do sed -i '' "s/Copyright [0-9]\{4\} The PipeCD Authors/Copyright $(date +%Y) The PipeCD Authors/g" $i; done
# Detect OS for sed -i compatibility
if [[ "$OSTYPE" == "darwin"* ]]; then
SED_IN_PLACE="sed -i ''"
else
SED_IN_PLACE="sed -i"
fi

grep -rl "Copyright [0-9]\{4\} The PipeCD Authors" $ROOT_DIR | while IFS= read -r i; do
echo "Updating copyright year in: $i"
$SED_IN_PLACE "s/Copyright [0-9]\{4\} The PipeCD Authors/Copyright $(date +%Y) The PipeCD Authors/g" "$i"
done

echo "Copyright year update completed."