diff --git a/lib/kamal/secrets/dotenv/inline_command_substitution.rb b/lib/kamal/secrets/dotenv/inline_command_substitution.rb index c9ef98799..16498ffbd 100644 --- a/lib/kamal/secrets/dotenv/inline_command_substitution.rb +++ b/lib/kamal/secrets/dotenv/inline_command_substitution.rb @@ -4,7 +4,7 @@ def install! ::Dotenv::Parser.substitutions.map! { |sub| sub == ::Dotenv::Substitutions::Command ? self : sub } end - def call(value, _env, overwrite: false) + def call(value, env, overwrite: false) # Process interpolated shell commands value.gsub(Dotenv::Substitutions::Command.singleton_class::INTERPOLATED_SHELL_COMMAND) do |*| # Eliminate opening and closing parentheses @@ -14,6 +14,7 @@ def call(value, _env, overwrite: false) # Command is escaped, don't replace it. $LAST_MATCH_INFO[0][1..] else + command = ::Dotenv::Substitutions::Variable.call(command, env) if command =~ /\A\s*kamal\s*secrets\s+/ # Inline the command inline_secrets_command(command)