Merge pull request #458 from basecamp/avoid-env-empty-file-warning
Fix empty file warning when uploading env files
This commit is contained in:
@@ -33,7 +33,7 @@ module Kamal::Utils
|
|||||||
end.string
|
end.string
|
||||||
|
|
||||||
# Ensure the file has some contents to avoid the SSHKIT empty file warning
|
# Ensure the file has some contents to avoid the SSHKIT empty file warning
|
||||||
env_file || "\n"
|
env_file.presence || "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a list of shell-dashed option arguments. If the value is true, it's treated like a value-less option.
|
# Returns a list of shell-dashed option arguments. If the value is true, it's treated like a value-less option.
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ class UtilsTest < ActiveSupport::TestCase
|
|||||||
Kamal::Utils.env_file_with_secrets(env)
|
Kamal::Utils.env_file_with_secrets(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "env file empty" do
|
||||||
|
assert_equal "\n", Kamal::Utils.env_file_with_secrets({})
|
||||||
|
end
|
||||||
|
|
||||||
test "env file secret" do
|
test "env file secret" do
|
||||||
ENV["PASSWORD"] = "hello"
|
ENV["PASSWORD"] = "hello"
|
||||||
env = {
|
env = {
|
||||||
|
|||||||
Reference in New Issue
Block a user