Skip to content

Commit

Permalink
Extract a couple of local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Jan 15, 2025
1 parent cf57e55 commit b6874f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tasks/versions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ namespace :versions do
last = VERSIONS.last
succ = VERSIONS.last.succ
puts "Latest version is #{last}. Creating version #{succ}..."
cp_r "source/#{last}", "source/#{succ}"
last_root = "source/#{last}"
succ_root = "source/#{succ}"
cp_r last_root, succ_root
puts "Creating empty What's New page..."
render_whats_new(succ)
puts "Creating announcement blog post..."
sh "middleman article 'Bundler #{succ}'"
puts "Updating latest version symlinks..."
Dir.glob("source/#{succ}/man/*.html.erb") do |file|
url = file.delete_prefix("source/#{succ}/")
Dir.glob("#{succ_root}/man/*.html.erb") do |file|
url = file.delete_prefix("#{succ_root}/")
latest_man = "source/#{url}"
FileUtils.ln_sf Pathname.new(file).relative_path_from(File.dirname(latest_man)), latest_man
end
Expand Down

0 comments on commit b6874f5

Please sign in to comment.