Skip to content

Commit

Permalink
Quietly bail if no version template file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Toland committed Apr 19, 2010
1 parent 3ff6528 commit 23f67be
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions recipes/app_version.rb
@@ -1,14 +1,16 @@
# this is a capistrano recipe that will use the templated version.yml.erb
# to produce the actual version.yml that the app_version plugin uses to
# to produce the actual version.yml that the app_version plugin uses to
# store version information.

namespace :app_version do

desc "Generate version.yml from variables"
task :generate_version_info, :roles => :app do
template = File.read("lib/templates/version.yml.erb")
result = ERB.new(template).result(binding)
put result, "#{release_path}/config/version.yml"
if File.exist?("lib/templates/version.yml.erb")
template = File.read("lib/templates/version.yml.erb")
result = ERB.new(template).result(binding)
put result, "#{release_path}/config/version.yml"
end
end
after "deploy:update_code", "app_version:generate_version_info"

Expand Down

0 comments on commit 23f67be

Please sign in to comment.