Skip to content

Commit

Permalink
Version update script
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed May 10, 2013
1 parent a279678 commit 436973f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,24 @@ task :runtime => [:compile] do |task|
Rake::Task["dist/handlebars.runtime.js"].execute
end

# Updates the various version numbers.
task :version => [] do |task|
# TODO : Pull from package.json when the version numbers are synced
version = File.read("lib/handlebars/base.js").match(/Handlebars.VERSION = "(.*)";/)[1]

content = File.read("bower.json")
File.open("bower.json", "w") do |file|
file.puts content.gsub(/"version":.*/, "\"version\": \"#{version}\",")
end

content = File.read("handlebars.js.nuspec")
File.open("handlebars.js.nuspec", "w") do |file|
file.puts content.gsub(/<version>.*<\/version>/, "<version>#{version}</version>")
end
end

desc "build the build and runtime version of handlebars"
task :release => [:build, :runtime]
task :release => [:version, :build, :runtime]

directory "vendor"

Expand Down

0 comments on commit 436973f

Please sign in to comment.