Skip to content

Commit 436973f

Browse files
committed
Version update script
1 parent a279678 commit 436973f

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

Rakefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,24 @@ task :runtime => [:compile] do |task|
9090
Rake::Task["dist/handlebars.runtime.js"].execute
9191
end
9292

93+
# Updates the various version numbers.
94+
task :version => [] do |task|
95+
# TODO : Pull from package.json when the version numbers are synced
96+
version = File.read("lib/handlebars/base.js").match(/Handlebars.VERSION = "(.*)";/)[1]
97+
98+
content = File.read("bower.json")
99+
File.open("bower.json", "w") do |file|
100+
file.puts content.gsub(/"version":.*/, "\"version\": \"#{version}\",")
101+
end
102+
103+
content = File.read("handlebars.js.nuspec")
104+
File.open("handlebars.js.nuspec", "w") do |file|
105+
file.puts content.gsub(/<version>.*<\/version>/, "<version>#{version}</version>")
106+
end
107+
end
108+
93109
desc "build the build and runtime version of handlebars"
94-
task :release => [:build, :runtime]
110+
task :release => [:version, :build, :runtime]
95111

96112
directory "vendor"
97113

0 commit comments

Comments
 (0)