Skip to content

Commit

Permalink
Fix support for multiline post create commands
Browse files Browse the repository at this point in the history
  • Loading branch information
vitobotta committed Jul 25, 2024
1 parent f39396e commit 71745b7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/hetzner/instance/create.cr
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ class Hetzner::Instance::Create
post_create_commands += microos_commands
end

additional_post_create_commands = additional_post_create_commands.map do |command|
if command.includes?("\n")
lines = ["|"]
command.split("\n").each do |line|
lines << " " + line
end
lines.join("\n")
else
command
end
end

post_create_commands += additional_post_create_commands + final_commands

"- #{post_create_commands.join("\n- ")}"
Expand Down

0 comments on commit 71745b7

Please sign in to comment.