Permalink
Browse files

Quietly bail if no version template file exists

  • Loading branch information...
1 parent 3ff6528 commit 23f67bee892586db1a92c441bbc6d56a58eabc0d @toland committed Apr 19, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 recipes/app_version.rb
View
@@ -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"

0 comments on commit 23f67be

Please sign in to comment.