Skip to content

Commit 8789a1b

Browse files
authored
Merge pull request #1346 from i7an/handle-parentheses
Handle parentheses in variables in commands
2 parents 54b2c79 + 7627f74 commit 8789a1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/kamal/secrets/dotenv/inline_command_substitution.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def install!
44
::Dotenv::Parser.substitutions.map! { |sub| sub == ::Dotenv::Substitutions::Command ? self : sub }
55
end
66

7-
def call(value, _env, overwrite: false)
7+
def call(value, env, overwrite: false)
88
# Process interpolated shell commands
99
value.gsub(Dotenv::Substitutions::Command.singleton_class::INTERPOLATED_SHELL_COMMAND) do |*|
1010
# Eliminate opening and closing parentheses
@@ -14,6 +14,7 @@ def call(value, _env, overwrite: false)
1414
# Command is escaped, don't replace it.
1515
$LAST_MATCH_INFO[0][1..]
1616
else
17+
command = ::Dotenv::Substitutions::Variable.call(command, env)
1718
if command =~ /\A\s*kamal\s*secrets\s+/
1819
# Inline the command
1920
inline_secrets_command(command)

0 commit comments

Comments
 (0)