zendframework / maintainers

Contributors and maintainers information for Zend Framework.
BSD 3-Clause "New" or "Revised" License
50 stars 26 forks source link

Host a tool for automatize the change of year #6

Open Maks3w opened 8 years ago

Maks3w commented 8 years ago

Every year we need to update the copyright for every place where the copyright holder.

These places are usually:

There are two patterns of copyrights:

We want a script tool for automatize the search and replace of the copyright years with the following rules.

  1. Files with Following years pattern must update the last year in the range with the actual one.
  2. Files with First year pattern must be replaced with the Following years pattern.

Tools can be proposed for to be merged on this repo or to be available for public use in any other repository,

We want you!

DASPRiD commented 8 years ago
#!/bin/bash

YEAR=$(date +"%Y")

for file in $(find . -type f); do
    sed -i 's/\(Copyright (c) [0-9]\{4\}\)\(-[0-9]\{4\}\)\?/\1-'"$YEAR"'/' $file
done;
Maks3w commented 8 years ago

Please make a Pull Request ;-)