lib/capistrano/cookbook/helpers/template.rb in capistrano-cookbook-0.2.1 vs lib/capistrano/cookbook/helpers/template.rb in capistrano-cookbook-5.0.0
- old
+ new
@@ -22,12 +22,14 @@
error "error #{from} not found"
end
end
def template_file(name)
- if File.exist?((file = "config/deploy/#{fetch(:full_app_name)}/#{name}.erb"))
+ if File.exist?((file = "config/deploy/#{fetch(:stage)}/#{name}.erb"))
return file
elsif File.exist?((file = "config/deploy/shared/#{name}.erb"))
+ return file
+ elsif File.exist?((file = "config/deploy/templates/#{name}.erb"))
return file
elsif File.exist?(file = File.expand_path("../templates/#{name}.erb",File.dirname(__FILE__)))
return file
end
return nil