Skip to content

Commit 23f67be

Browse files
author
Phil Toland
committed
Quietly bail if no version template file exists
1 parent 3ff6528 commit 23f67be

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

recipes/app_version.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# this is a capistrano recipe that will use the templated version.yml.erb
2-
# to produce the actual version.yml that the app_version plugin uses to
2+
# to produce the actual version.yml that the app_version plugin uses to
33
# store version information.
44

55
namespace :app_version do
66

77
desc "Generate version.yml from variables"
88
task :generate_version_info, :roles => :app do
9-
template = File.read("lib/templates/version.yml.erb")
10-
result = ERB.new(template).result(binding)
11-
put result, "#{release_path}/config/version.yml"
9+
if File.exist?("lib/templates/version.yml.erb")
10+
template = File.read("lib/templates/version.yml.erb")
11+
result = ERB.new(template).result(binding)
12+
put result, "#{release_path}/config/version.yml"
13+
end
1214
end
1315
after "deploy:update_code", "app_version:generate_version_info"
1416

0 commit comments

Comments
 (0)