Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

Commit

Permalink
2017 → 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Jun 7, 2018
1 parent 7d031f8 commit 7159171
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,4 @@ Only commit changes to Trix’s source (everything except the compiled files in

---

© 2017 Basecamp, LLC.
© 2018 Basecamp, LLC.
26 changes: 14 additions & 12 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Release

build
update_package_json
update_license
update_copyright_year
commit_changes
create_release
npm_publish
Expand Down Expand Up @@ -45,18 +45,20 @@ class Release
pathname.write(JSON.pretty_generate(data) + "\n")
end

def update_license
puts "Updating LICENSE…"
def update_copyright_year
puts "Updating copyright year…"

pathname = Pathname.new("LICENSE")
contents = pathname.read
year = Time.now.year
%w( LICENSE README.md ).each do |filename|
pathname = Pathname.new(filename)
contents = pathname.read
year = Time.now.year

(year - 1).downto(year - 3) do |previous_year|
pattern = / #{previous_year} /
if contents =~ pattern
pathname.write(contents.gsub!(pattern, " #{year} "))
break
(year - 1).downto(year - 3) do |previous_year|
pattern = / #{previous_year} /
if contents =~ pattern
pathname.write(contents.gsub!(pattern, " #{year} "))
break
end
end
end
end
Expand Down Expand Up @@ -87,7 +89,7 @@ class Release
end

def pathspecs
%w( dist/ src/ package.json LICENSE )
%w( dist/ src/ package.json LICENSE README.md )
end

def dist_pathnames
Expand Down

0 comments on commit 7159171

Please sign in to comment.