Skip to content

Commit

Permalink
Write latest version to config
Browse files Browse the repository at this point in the history
fix #6675
  • Loading branch information
DirtyF committed Jan 6, 2018
1 parent 1ff77a5 commit 6ce7079
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions rake/site.rake
Expand Up @@ -7,7 +7,7 @@
#############################################################################

namespace :site do
task :generated_pages => [:history, :version_file, :conduct, :contributing, :support]
task :generated_pages => [:history, :latest_version, :conduct, :contributing, :support]

desc "Generate and view the site locally"
task :preview => :generated_pages do
Expand Down Expand Up @@ -84,9 +84,13 @@ namespace :site do
siteify_file(".github/SUPPORT.markdown", "title" => "Support")
end

desc "Write the site latest_version.txt file"
task :version_file do
File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) } unless version =~ %r!(beta|rc|alpha)!i
desc "Write the site latest version"
task :latest_version do
return if version =~ %r!(beta|rc|alpha)!i
config_file = File.join(docs_folder, "_config.yml")
contents = File.read(config_file)
File.write(config_file, contents.sub(%r!(?:version\s*:\s+)(.+)!, "version: #{version}"))
File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) }
end

namespace :releases do
Expand Down

0 comments on commit 6ce7079

Please sign in to comment.