You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
551 B
Ruby
21 lines
551 B
Ruby
4 years ago
|
#!/usr/bin/env ruby
|
||
|
# frozen_string_literal: true
|
||
|
|
||
|
# SPDX-License-Identifier: MIT OR Apache-2.0
|
||
|
#
|
||
|
# Copyright (c) 2021 Andre Richter <andre.o.richter@gmail.com>
|
||
|
|
||
|
require 'date'
|
||
|
|
||
|
files = `git ls-files`.split("\n")
|
||
|
files = files.delete_if { |f| File.symlink?(f) }
|
||
|
files = files.join(' ')
|
||
|
|
||
|
year = Date.today.year
|
||
|
|
||
|
# Update "Copyright (c) 20..-20.."
|
||
|
`sed -i -- 's,\\(Copyright .c. 20..\\)-20..,\\1-#{year},g' #{files}`
|
||
|
|
||
|
# Update "Copyright (c) 20.. Name" -> "Copyright (c) 20..-20.. Name"
|
||
|
`sed -i -- 's,\\(Copyright .c. 20..\\) ,\\1-#{year} ,g' #{files}`
|