Only envify if there is a template file available

This commit is contained in:
David Heinemeier Hansson
2024-05-13 17:08:53 -07:00
parent dc1f707a56
commit 938ac375a1

View File

@@ -186,12 +186,16 @@ class Kamal::Cli::Main < Kamal::Cli::Base
env_path = ".env"
end
if File.exist?(env_template_path)
File.write(env_path, ERB.new(File.read(env_template_path), trim_mode: "-").result, perm: 0600)
unless options[:skip_push]
reload_envs
invoke "kamal:cli:env:push", options
end
else
puts "Skipping envify (no #{env_template_path} exist)"
end
end
desc "remove", "Remove Traefik, app, accessories, and registry session from servers"